Closed (fixed)
Project:
XML sitemap
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2009 at 10:41 UTC
Updated:
21 Apr 2009 at 06:30 UTC
Hi,
Fist of all, thanks for the great module!
Hope somebody can help me with using the hook mentioned above.
As far as I understand from the documentation, just dumping all links in the database should be enough? Code below returns the urls to a special vocabulary used by Ubercart which does not show in sitemaps.
How could I use the hook to let them show?
Hope somebody could help,
Br
Mark
global $base_url;
$tree = taxonomy_get_tree(variable_get('uc_catalog_vid', 0));
foreach ($tree as $term) {
$link[] = array(
'loc' => $base_url .'/'. drupal_get_path_alias(uc_catalog_path($term)),
'lastmod' => 0,
'changefreq' => 0,
'priority' => 0.8,
);
}
dprint_r($link);
Comments
Comment #1
avpadernohook_xmlsitemap_links()is thought to be used by third-party modules to add links not handled by already existing modules; in the case reported, there is already xmlsitemap_term.module, which handles the taxonomy term links. If you are not seeing the links associated with a particular vocabulary, then maybe that vocabulary is not selected to be included in the site map.There is no need to implement
hook_xmlsitemap_links()in this case.Comment #2
avpadernoComment #3
splash112 commentedHi Kiam,
Thanks for your quick reply!
Still this case is a little different. True that the Ubercart catalog also has an "normal" taxonomy term which gets an term/path but in addition Ubercart will supply the term with an additional path. So every term will have 2 paths, 1 automatically included in xmlsitemap, but which is rarely used (and I excluded from the sitemap) and the important one which is not...
I have simply no idea why the guys at Ubercart chose for an extra path, but I still would like to include it in the sitemap.
I still hope to write a small module to do this and get the right paths in the sitemap.
Thanks
Mark
Comment #4
avpadernoThis would not be a problem if Ubercart would implement
hook_term_path(). The hook is not documented for Drupal 5, but from the code of thetaxonomy_term_path()function is clear that such hook is called from the function.To notice that the function doesn't directly handle the taxonomy terms for forum.module for which would return the generic value (
'taxonomy/term/'. $term->tid).To create a new module just to handle the Ubercart taxonomy terms is possible, but would conflict with the module that already handles the taxonomy term links.
Comment #5
splash112 commentedMany thanks!
Worked like a charm. Fixed a function and suggested it with Ubercart:
http://drupal.org/node/425984
Best regards
Mark