Relational URL pattern
Feature request
Summary
Allow querying relational fields in the URL pattern like /prefix/[relation.slug_field].
Why is it needed?
For better dynamic URL patterns.
Related issue(s)/PR(s)
#75
Is it possible to make the population of relational fields recursive for example /prefix/[relation.relation.slug_field]/[relation.slug_field]/[slug_field].
Also a feature for making deeply nested routes would be cool, such as /prefix/[relation.slug_field*]/[slug_field], which would probably also require recusively populating fields.
Thanks for all the hard work you have put into this plugin already!
Yeah, making it recursive makes sense to me. Making it possible for you to go infinitely deep with the relation nesting.
Though this syntax I don't get /prefix/[relation.slug_field*]/[slug_field].
What exactly are you querying with the * character?
Any updates on this, also can you document this feature ?
The feature is in beta. You can install it like this:
yarn add strapi-plugin-sitemap@beta or npm install strapi-plugin-sitemap@beta
Thank for this feature !
We can't do the same with a component relation ?
@boazpoolman I just realised this must be what @thibaultcarlier must have meant from that comment.
I assumed they meant a component inside of a relation.
Right now if you have a Component on an object you can't reference any fields inside, essentially only root fields are accessible.
@boazpoolman I just realised this must be what @thibaultcarlier must have meant from that comment.
Yes exactly, and I noticed that you can't make it link to components. But I find it sad :/
Yeah @boazpoolman has suggested this is how it should work, so hopefully we will see an update soon to patch this, as the relation update is still in beta :)
Good news ! Thank for your work !
@boazpoolman Just bumping this, any chance we can see this update move forward for components?
Hey @boazpoolman are you still looking to implement the update here for components?
I have planned to work on the beta in Q2 of this year. I'll be sure to look at the components relations as wel.
Up until that moment you are free to fork the beta branch and work on this yourself.
I have planned to work on the beta in Q2 of this year.
Awesome that's what I needed to know, it means i'll have to find an alternative solution in the mean time but that's fine :)
Thanks @boazpoolman !
I've opened a PR (#123) that adds the ability to use component fields in the URL pattern.
Legend 👍
This feature has been released with version 3.0.0 of the Sitemap plugin.
You are now able to use relational fields in your URL pattern. Like so: /pages/[category.slug]/[slug]