By Robardi56 on
Hi,
i'm looking to achieve two separates things on page.tpl.php :
1) have a code displayed only on the frontpage.
2) Have a code displayed only for unregistered user, if not unregistered (registered) display other code.
How can I do this ?
Thanks,
Brakkar
Comments
_
Probably the simplest way is with the http://drupal.org/project/front module.
Thanks, but I would prefer
Thanks, but I would prefer code versions, in particular for 2) that may also appear on other page than the frontpage.
You can use the variable
You can use the variable
$is_frontto determine if the user is on the front page. This variable isTRUEfor the front page andFALSEfor all other pages.To determine if a user is logged in, you can use the function
user_is_anonymous().Contact me to contract me for D7 -> D10/11 migrations.
Documented
http://api.drupal.org/api/drupal/modules--system--page.tpl.php