By nirvanajyothi on
I use this PHP code to show a block only on certain subdomains.(built using the Domain access module.)
global $_domain;
if ($_domain['domain_id'] == 0 || $_domain['domain_id'] == 28) {
return TRUE;
}
return FALSE;
What happens is, with the above code the block is displayed on all pages while i want the block to be shown only on the front page of these subdomains.
What should i add to the above code to show the block only on the front page ?
Any help will be deeply appreciated.
-thank you
Comments
just add &&
just add
&& (drupal_is_front_page())to your conditions.===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
So,is this the right
So,will this be the right way to go?
-thank you
Medicine,Surgery ...and Drupal.
I think you have your
I think you have your brackets in the wrong place.
You need to check you are on the front page ANDed with the result of "is this a valid domain?"
Try-
Regards: Colin
It works well!! Thank you
It works well!!
Thank you WorldFallz & colin_e for the help.
Medicine,Surgery ...and Drupal.
Can you please explain what
Can you please explain what should be added instead of
&& drupal_is_front_pagefor displaying the block only on a particular node (Eg.www.example.com/content/node/300)
-thank you
Medicine,Surgery ...and Drupal.
probably something
probably something like:
Replace {your-nid} with the number of the node in question.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Thank you
will try that out.
Thanks very much WorldFallz !
Medicine,Surgery ...and Drupal.