-
-
Notifications
You must be signed in to change notification settings - Fork 539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.x] Add routes control (and localization) to taxonomies #8627
base: 5.x
Are you sure you want to change the base?
[5.x] Add routes control (and localization) to taxonomies #8627
Conversation
This PR looks exactly like what I need. Currently having to do an unwieldy Laravel route that does the term/taxonomy fetching, etc. Am I right in assuming this will prefetch the entries associated with the tax/term? I think currently it does this without customizing the url, just wanted to make sure it doesn't mess it up.
I like the semantics of this - being able to specify both the tax archive page and the term archive page. |
Correct. |
I have run into another issue with this setup. Sometimes I want to nest the terms on a page like so:
Perhaps this is a use case that shouldn't be supported by Statamic by default, but in my opinion it would be nice to have as robust routing features for terms as we have for entries. |
@godismyjudge95 it still follows the index/show approach, so you could mount it on If you want direct mounting, consider using a collection. |
I too, am a fan of the idea of being able to customize my taxonomy routes. |
@ryanmitchell Does this remove the automatic taxonomy routing? Because I ran into a bug with it and will hold off fixing it if this PR removes it anyway. |
@aerni it doesn’t remove it but allows you to do something instead of it |
@ryanmitchell You might want to take a look at this PR. Just to ensure we don't conflict. #10398 |
@aerni doesn't seem to conflict |
I came here from #2403, and am looking to define the route as a query parameter to something like this If not, would there need to be a seperate field to overwrite the URL used for the "Visit URL" button here? For the live preview this is currently already working in v5. |
it would. but this PR has been sitting a long time, I wouldnt rely on it getting merged! |
indeed! @jasonvarga are there any blockers or conflicts preventing this merge here? seems like a very sensible addition. |
Am I right in thinking this PR, together with a future option to make taxonomies mountable (so you can optimize those pages for SEO) would make them great again? |
@jasonvarga @duncanmcclean Any update on this? |
Sorry, we don't have an update on this. When we do, we'll update this PR. |
Let us know if anything's missing that the community could contribute :) |
You may have something else entirely in mind for this, but I had a bit of free time and thought it worth working on.
This PR adds the ability to specify routes in the taxonomy config:
And allows them to be localized:
Im sure theres stuff I haven't thought through, but hey its a start.
Closes #2403
Closes #2334
Edit:
One of the differences between this and collection routes is that we are trying to make it work for both the 'taxonomy' view and the 'term' view. It occurred to me that we could allow the routes to be more like the collection routes in that the
{slug}
could be specified in the route, and we take everything up to/{slug}
as the 'taxonomy' route. I guess another option would be to specify seperate routes for taxonomy and terms.