I'd like to have a dynamic sitemap link. I tried token to start off with thinking I could have a custom url and then use a token to change it. But xmlsitemap custom doesn't understand tokens it seems.

So next I tried insert in my site custom bits and bobs module

function mymodule_xmlsitemap_links() {
  $links = array();

  $links[] = array(
    'type' => 'mytype',
    'id' => 1,
    'loc' => 'pathtopage',
    'lastmod' => 346245692,
    'changefreq' => 4600,
  );

  return $links;
}

Why doesn't that work? It says here http://drupalcontrib.org/api/function/hook_xmlsitemap_links/6 that is waht to do, I think.

Comments

malc_b’s picture

I think I have it sorted. It also needs mymodule_xmlsitemap_links_clear() and mymodule_xmlsitemap_links_batch_info() in order for it to work.

dave reid’s picture

Only need to implement hook_xmlsitemap_links_clear().

malc_b’s picture

Thanks

dave reid’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.