strapi-plugin-sitemap icon indicating copy to clipboard operation
strapi-plugin-sitemap copied to clipboard

Allow query params

Open michaelroth-xx opened this issue 2 years ago • 2 comments

Right now it is not possible to create a sitemap entry with query params. The input field simply permits typing in a questionmark. e.g.:

  • some-overview?page=2
  • /?location=[id]

Is there any reason for this? Or any workaround?

Thank you!

michaelroth-xx avatar Oct 28 '22 15:10 michaelroth-xx

Also very much interested in this feature, I have a couple of sites that would greatly benefit from this and are a little limited at the moment

ThomasValois avatar Dec 14 '22 00:12 ThomasValois

Thanks @michaelroth-xx and @ThomasValois for your interest in this feature.

I've been thinking about it and it seems like an easy fix; just allow them in the pattern.

The only real issue I see here is the use of [] in the params. In the pattern those characters are used to escape the fields, like; /page/[id]. Though in query params those might be used to specify the index in an array, like: /page?param[0]=test

I could say; all [] in the pattern that come after the ? should not be escaped as fields. Though you then loose the ability to pass a dynamic value in the query params, like: /page?param=[id]

If any of you wanna help figure this out I'll be happy to implement it.

boazpoolman avatar Jun 17 '23 18:06 boazpoolman