How can I add a user's account path (user/*) on the sitemap using the API?
I tried with this code to add the link of the updated user but nothing happened when I rebuilt the sitemap.
function hook_user_user_update(&$edit, $account, $category) {
$link = xmlsitemap_user_create_link($account);
xmlsitemap_link_save($link);
}
I want to use this in Rules.
Thanks a lot!
Comments
Comment #1
Anonymous (not verified) commentedHave you enabled xmlsitemap_user? Do anonymous users have the ability to see the user/% link?
Comment #2
theodorosploumisYes I have done that.
I am trying to add the user link for specific user roles that's why I use rules.
Also, the default settings for users is "excluded" from the sitemap.xml.
Comment #3
Anonymous (not verified) commentedI can see a feature request from this as adding the configuration to the roles UI so that specific roles have differing defaults much the same way as differing content types have differing defaults.
As for what you're trying to do, what does the $link['status'] and the $link['access'] have for a value after you call xmlsitemap_user_create_link?
Comment #4
theodorosploumisHow can I see $link['status'] and $link['access'] using the code I already have?
Comment #5
Anonymous (not verified) commentedI usually do something stupid like the below. The devel module has debug methods and procedures to allow you to leave the debug statements in the code if you want to venture with it.
Comment #6
theodorosploumis