function _xmlsitemap_node_frontpage in XML sitemap 5
Same name and namespace in other branches
- 5.2 xmlsitemap_node/xmlsitemap_node.module \_xmlsitemap_node_frontpage()
Get the nid of the front page node.
Return value
Integer of front page node ID, or 0 if front page is not a node.
Related topics
1 call to _xmlsitemap_node_frontpage()
- _xmlsitemap_node_links in xmlsitemap_node/
xmlsitemap_node.module - Get node links.
File
- xmlsitemap_node/
xmlsitemap_node.module, line 114 - Adds nodes to the site map.
Code
function _xmlsitemap_node_frontpage() {
static $nid;
if (!isset($nid)) {
$nid = 0;
$frontpage = explode('/', drupal_get_normal_path(variable_get('site_frontpage', 'node')));
if (count($frontpage) == 2 && $frontpage[0] == 'node' && is_numeric($frontpage[1])) {
$nid = $frontpage[1];
}
}
return $nid;
}