4

Nice to know for drupal beginners:

What is a front page in drupal and particularly in which case is $is_front true ?

11

$is_front is set on any template from _template_preprocess_default_variables() (itself called from template_preprocess()). It uses the result of the drupal_is_front_page() function.

drupal_is_front_page() will returns TRUE, if the path of the current page matches the site_frontpage configuration variable. This variables can be set from the "Site Information" configuration page.

Usually there is only a single front page on a Drupal site. If you use the Variable translation module (part of the Internationalization project), then you could translate the site_frontpage configuration variable and have a different front page for each enabled language.

It may also be possible to have other module alter the value of the variables on each request to have multiple front pages. Additional module may also alter the value of $is_front in all or only a few specific templates. However, I cannot think of any useful use case for this, except torturing the template developer with inconsistency.

|improve this answer|||||
1

drupal_is_front_page() - returns the bool value true if it's the front page.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.