pluginpal / strapi-plugin-sitemap

🔌 Generate a highly customizable sitemap XML in Strapi CMS
https://www.pluginpal.io/plugin/sitemap
MIT License
253 stars 53 forks source link

Allow query params #99

Open michaelroth-xx opened 2 years ago

michaelroth-xx commented 2 years ago

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.:

Is there any reason for this? Or any workaround?

Thank you!

ThomasValois commented 1 year ago

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

boazpoolman commented 1 year ago

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.