We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Collection Routing including parent

Jason Lund November 6, 2020 by Jason Lund

Hello,

I am trying to include the slug of the parent in a collection's routing.

For example: /accomplishments/{parent-slug}/{entry-slug} would resolve to /accomplishments/commentator/47-events

Given the following entry structure in my Accomplishments collection:

- Commentator
  - 47 Events
- Family
  - Four Children

I would also like /accomplishments/{parent-slug}/ to resolve to a 404 as each parent will be listed on the /accomplishments/ page.

I found this previous post but I think it's about Statamic v2. I don't know see "Collection Categories" or a routes.yaml file in the docs.

I'm unable to accomplish this under the Route setting of the collection and I am unsure how/if it is possible with custom routing.

Any help would be greatly appreciated.

Thanks.

Answered by Erin Dalzell!
>>>>>>> Answered <<<<<<<
4 Replies
2 Followers