hook_xmlsitemap_links

Versions
5
hook_xmlsitemap_links($type = NULL, $excludes = array())
6
hook_xmlsitemap_links()

Retrieve a array of links to include in the sitemap.

See also

hook_xmlsitemap_links_clear()

Return value

An array of link arrays with the following keys and values:

  • 'type' => The type of link (node, user, kitten, etc.).
  • 'id' => The ID of the link ($node->nid, $user->uid, etc.).
  • 'loc' => The un-aliased Drupal path to the item.
  • 'lastmod' => The UNIX timestmap of when the item was last modified.
  • 'changefreq' => The interval, in seconds, between the last set of changes.
  • 'priority' => An optional priority value between 0.0 and 1.0.

Code

contributions/xmlsitemap/xmlsitemap.api.php, line 29

<?php
function hook_xmlsitemap_links() {
  $links = array();

  $links[] = array(
    'type' => 'mymodule',
    'id' => 1,
    'loc' => 'mymodule/menu/path',
    'lastmod' => 346245692,
    'changefreq' => 4600,
  );

  return $links;
}
?>