Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I have enabled xmlsitemap for a Menu. Menu items got generated in sitemap.xml file. But there were child items for the menu, which were not generated in the xml file. Does the module only supports the Menu items only for first level items ?
Please advise
Thanks,
Harysh
Comment | File | Size | Author |
---|---|---|---|
#13 | child-items-in-menu-are-not-generated-in-xml-file-2974760-13.patch | 2.35 KB | agoradesign |
| |||
#2 | child-items-in-menu-are-not-generated-in-xml-file-2974760-2.patch | 2.24 KB | elimw |
|
Comments
Comment #2
elimw CreditAttribution: elimw commentedHere's a patch I've created which recursively gets child menu links.
Comment #3
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedThank you @elimw, looks clean and I will test it in the coming days. Would you mind creating another issue for 3.x and porting your patch? Should only be some minor differences to 2.x.
Comment #6
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedFixed both in 2.x and 3.x Thanks!
Comment #7
harysh CreditAttribution: harysh commentedThank you @elimw for the patch, child items are now listed in the xml file.
Comment #8
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commented@harysh The has been already committed to the development version of the module.
Comment #10
agoradesign CreditAttribution: agoradesign commentedI haven't seen that this is already fixed. My solution that I was close to post here as patch would have been a one liner -> you could have added this menu tree transform call: ['callable' => 'menu.default_tree_manipulators:flatten']
ending up in ->
Comment #11
agoradesign CreditAttribution: agoradesign commentedAnyway, a new tagged release would be great, because this is really an important bugfix
Comment #12
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commented@agoradesign Interesting, would you mind creating a patch for current 2.x dev so we can run tests through it? If we can do this with a one liner, we should.
Comment #13
agoradesign CreditAttribution: agoradesign commentedok, here's the patch, reverting the commit and adding the flatten tree manipulator.
I've only tried this solution once yesterday and it seemed to work like a charm. After I saw this already committed fix, I've switched to that version though.
PS: I cannot reopen the issue
Comment #14
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedComment #16
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedThanks