Forum

Thread tagged as: Question

If URL contains value

I am using a template in runway for a whole load of pages in a site. Most of the pages are quite simple but others need some additional content adding from elsewhere in the site. What I thought I'd do is look at the url and display the additional content.

I am using:

if ($url == 'link-1') {
                            echo '[insert custom content] ';
                          } else {
                            echo '[do nothing]';
                          }

I'm sure there's a simple solution?

Similar forum post here https://forum.grabaperch.com/forum/01-30-2015-testing-for-string-fails

Ben Stillwell

Ben Stillwell 1 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

How are you populating $url?