I’m having a little trouble controlling page-specific block display in Drupal…
My URL’s will be of this typical structure:
http://www.mysite.co.uk/section-name/sub-page/sub-sub-page
The ‘section-name’ will effectively be fixed, but there will be many sub-pages (far too many to explicitly reference).
I need to somehow control block display as follows:
One block will show on all pages where URL contains ‘section-name/sub-page’ but not on pages ‘section-name/sub-page/sub-sub-page’
Conversely, another block will show on all pages where URL contains ‘section-name/sub-page/sub-sub-page’ but not on pages ‘section-name/sub-page’
My only idea is to do a bit of PHP that looks for the string ‘section-name’ and then also counts URL parts (or even the number of slashes). Not sure how to implement that though 🙂
Your help would be appreciated!
You can use asterisks and slashes as wildcards for the level of hierarchy. For example, to only show a block when you’re on a page that’s 3 levels deep, you’d do:
Or you can add the section name before that, like: