In Drupal, can you control block display according to e.g. number of URL parts?
- by james6848
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!