Can anyone tell me the php code that would allow me to make a block visible only on the first page of a term page? I have a taxonomy term as my home page, using PathAuto for cleaner paths... so the home page path is http://mywebsite.com/headlines, with "headlines" as the taxonomy term, which has a pager at the bottom. The first page shows 6 node teasers, then it goes to page 2, 3, etc.
If I set a block to be visible on the of the site, I get the block visible on the headlines page, but I also get it visible on consecutive pages of that term.
I want the block visible on only these pages:
http://mywebsite.com/
http://mywebsite.com/headlines
http://mywebsite.com/headlines?page=0
I don't want it visible on these pages, which still includes:
http://mywebsite.com/headlines?page=1
http://mywebsite.com/headlines?page=2
...
http://mywebsite.com/headlines?page=697
etc...
Please... can anyone solve this?
Comments
Comment #1
nevets commentedHow about
Comment #2
gregarios commentedThanks for your code. I'd just come up with a similar solution:
Actually, since even
headlines/?page=1was qualifying as a<front>to the block, wouldn't your code return true just like<front>since it would never get past the first if?Which is a better way?
Comment #3
gregarios commentedMy solution posted does seem to work in all tested circumstances. Fixed. :-)
Comment #5
artscientific commentedThank you for this nevets, tried 3 other solutions that did not work before finding yours! BTW the other solution on this page did not work for me.