drupal_is_front_page

Versions
4.7 – 7
drupal_is_front_page()

Check if the current page is the front page.

Return value

Boolean value: TRUE if the current page is the front page; FALSE if otherwise.

▾ 9 functions call drupal_is_front_page()

blogapi_init in modules/blogapi/blogapi.module
l in includes/common.inc
Format an internal Drupal link.
locale_block in modules/locale/locale.module
Implementation of hook_block(). Displays a language switcher. Translation links may be provided by other modules.
menu_get_active_breadcrumb in includes/menu.inc
Get the breadcrumb for the current page, as determined by the active trail.
menu_set_active_trail in includes/menu.inc
Sets or gets the active trail (path to root menu root) of the current page.
menu_tree_page_data in includes/menu.inc
Get the data structure representing a named menu tree, based on the current page.
template_preprocess in includes/theme.inc
Adds a default set of helper variables for preprocess functions and templates. This comes in before any other preprocess function which makes it possible to be used in default theme implementations (non-overriden theme functions).
template_preprocess_page in includes/theme.inc
Process variables for page.tpl.php
theme_links in includes/theme.inc
Return a themed set of links.

Code

includes/path.inc, line 218

<?php
function drupal_is_front_page() {
  // As drupal_init_path updates $_GET['q'] with the 'site_frontpage' path,
  // we can check it against the 'site_frontpage' variable.
  return $_GET['q'] == drupal_get_normal_path(variable_get('site_frontpage', 'node'));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.