By tsorelle on
I tried to restrict a block to show on the homepage only. With the option 'Show on the listed page only' I could not figure out how to indicate the home page. '/' did not seem to work nor did blank.
Finally I resorted to 'Show if the following PHP code returns TRUE' and inserted:
<?php
if ( empty($_SERVER['QUERY_STRING']))
return true;
return false;
?>
Pretty ugly, isn't there is a better way than that?
Comments
Select "Show on the listed
Select "Show on the listed page only" and in the text box below type:
I find the descriptive text helpful
As a relative newbie to Drupal, I find the descriptive text below the fields to often be helpful. I found this for the block visibility which mentions the <front> code:
"Nice to meet you Rose...run for your life." - The Doctor
Yes, but <front> isn't quite what I need
Yes, but I use an internal page, http://kpbj.com/headlines as my home page. How can I make it only on the first page of these pages? (IE: not /headlines?page=1 etc.)
Re:
Hi there....
We were having the same problem and found that if you get the node path of the page you want restricted it would do the trick.
So for instance if you do not want block or page to appear on the home page you would type: front and for any other page or block you would have to type in the node path:e.g node/2
I hope this helps you cause it worked a treat for us....
If not just get back to us and we can try work it out.....
Cheers
same
hi i tried this code , it worked but when i move from my home page and then go back on home the blocks doesn't appear. what should i do?