You are here

function _xmlsitemap_term_frontpage in XML sitemap 5

Get the tid of the front page term.

Return value

Integer of front page term ID, or 0 if front page is not a term.

Related topics

1 call to _xmlsitemap_term_frontpage()
_xmlsitemap_term_links in xmlsitemap_term/xmlsitemap_term.module
Get term links.

File

xmlsitemap_term/xmlsitemap_term.module, line 98
Adds terms to the site map.

Code

function _xmlsitemap_term_frontpage() {
  static $tid;
  if (!isset($tid)) {
    $tid = 0;
    $frontpage = explode('/', drupal_get_normal_path(variable_get('site_frontpage', 'node')));
    if (count($frontpage) == 3 && $frontpage[0] == 'taxonomy' && $frontpage[1] == 'term' && is_numeric($frontpage[2])) {
      $tid = $frontpage[2];
    }
    elseif (count($frontpage == 2) && $frontpage[0] == 'forum' && is_numeric($frontpage[1])) {
      $tid = $frontpage[1];
    }
  }
  return $tid;
}