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;
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.