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.
I have some views that are filtered by variables in the url. For example:
www.mywebsite.com/hotels?city=london
www.mywebsite.com/hotels?city=miami
...
I want to insert some of these urls as custom links into XML-Sitemap 2. But I can only insert the path "hotels". If I want to insert the path "hotels?city=london" for example, I get the following error:
The custom link hotels?city=london is either invalid or it cannot be accessed by anonymous users.
Is there a way to insert such paths?
Comments
Comment #1
Dave ReidUgh, adding query support to the custom links isn't really going to be easy. It might be easier and better for you to make your view paths work like
hotels/city/london
or something similar. I'm going to have to leave this as postponed for now.Comment #2
Dave ReidComment #3
tinem CreditAttribution: tinem commentedDid you ever get this solved and if yes how, please?
Comment #4
neclimdulDependent on #839636: Support paths with query arguments
Comment #5
zandit CreditAttribution: zandit commented+1 for this feature request.
"Ugh" is exactly what I said after seeing how this is(n't) handled. I'd love to pitch in, but having only worked with it for a few hours would certainly break something: it's not a simple patch. It would be great to just be able to alter the second argument passed to url() in
xmlsitemap_generate_chunk()
via a hook or ideally in the data of the $link array itself.Since this module is useful and robust in other respects... I guess it's down to rewriting views. :'(