Needs work
Project:
XML sitemap
Version:
7.x-2.x-dev
Component:
xmlsitemap_menu.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 May 2013 at 16:21 UTC
Updated:
21 Dec 2023 at 03:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
vidorado commentedHere a patch to not include all special menu item links in XML Sitemap (those whose link_path starts with a "<" and ends with a ">")
It applies to 7.x-2.0-rc2
Comment #2
vidorado commentedForgot to change the issue status
Comment #3
Anonymous (not verified) commentedDave does this one line patch look correct to you?
Comment #4
finex commentedThe patch seems correct.
Comment #5
jippie1948 commentedI used the patch to update the 2.0 version and everything works fine!
My question is: Why is this patch against version 7.x-2.0-rc2 not implemented in the final version 7.x-2.0?
Thanks,
JP
Comment #6
sebi commentedI've applied this patch and it too works in the latest 2.0 stable. Reminder to those searching that you need to rebuild your sitemap links for this fix to take effect.
Comment #7
agileware commentedWorks. Let's get this patch committed.
Comment #8
dave reidWould it be better just to check if
strpos($menu_item['link_path'], '<') === 0rather than running a regex on each individual menu link? Would it also be good to change xmlsitemap_menu_xmlsitemap_index_links() to exclude these from the query?Comment #9
dave reidComment #10
dave reidComment #11
gappleHere's a patch to move things along; I've also included an update hook to remove existing records for special items.
A remaining task is indicating that the sitemap files need to be recreated afterwards, ideally conditional on any items actually being deleted.
There is also a gap in that if a menu item is changed to a special item, it will not be removed from the xmlsitemap table.
Comment #12
dxxPatch #11 worked for me with current Commerce Kickstart 2.x (and special_menu_items).
Simply need to rebuild the XML sitemap after patching (admin/config/search/xmlsitemap/rebuild).
Comment #13
Clemens Sahs commented#11 works fine for me. Merge after review.
Comment #14
romansta commented#11 works for me.
Comment #15
sreenivas bttv commentedHi,
Child menu links are not adding to sitemap. Please give me solution. I already updated this issue at https://www.drupal.org/node/2485337, but not received any update.
Comment #16
perelesnyk commentedComment #17
jainv18 commented#11 not working for me. Using the version 7.x-2.2 of xmlsitemap module.
Comment #18
Nick Robillard commented#11 works as expected.
Comment #19
dave reidUpdate hooks for 7.x-2.x should start with 72XX. This is also missing a flag to regenerate the sitemap if it does delete any records that were visible.
Does this affect the performance of the query at all? Should it be something that just stays in xmlsitemap_menu_xmlsitemap_process_menu_links() instead?
<front>will no longer appear? I assume that's ok since we manually add in the front page.<none>or another invalid value, should affect the state of the row in the xmlsitemap table, which it seems like this patch does not account for. Instead of "skipping" these records, we should likely be setting $link['access'] to FALSE if the link_path is not a valid item.Comment #20
robbdavis commentedSo.. #19 suggests this patch isn't quite ready.
In the meantime, can anyone see any issues with using this to simply pull links out of the sitemap:
It seems to work.
Comment #21
naczus commentedApplied patch #11 on project version 7.x-2.3 and modified query to apply the scape character '\' on NOT LIKE clause query:
Now, rebuild sitemap links and special menu items are excluded from sitemap.
I hope it helps!
Comment #22
Aritra Banerjee commentedHi folks, better hook for removing element without db query is hook_xmlsitemap_link_alter. I am providing one sample code where element lists are removed by checking the path alias. Though if it can be managed by disabling that specific content type from back-end, that would be best. Suggestions are welcome.
Comment #23
weavie commentedI am also using a custom module like #20. As far as I can tell it works fine. Thanks.
Comment #24
gravisrs commented#20 is not exact hook (&$link is an array). Try this:
<nolink>,<separator> - are from Special menu items module
<view> - is from Menu Views module
<firstchild> - is from Menu Firstchild module
Comment #25
agelospanagiotakisalso add
<block>it's from megamenu module
Comment #26
aquaphenixRe-rolling #11 since it doesn't apply to release 7.x-2.7