Closed alexveklenko closed 1 month ago
Only include {mount}
at the top level.
route: '{{ depth == 1 ?= mount }}/{{ parent_uri }}/{{ slug }}'
or
route: '{{ if depth == 1 }}{{ mount }}/{{ /if }}{{ parent_uri }}/{{ slug }}'
Hi @jasonvarga, thank you very much!
Bug description
Problem: {parent_uri} appends
{mount}
at every point in URI hierarchy, so with depth > 1 it starts to add up, e.g.: given permalink structure/{mount}/{parent_uri}/{slug}
it behaves like this: 1st level -/top/lvl1
(parent_uri = ''
) 2nd level -/top/top/lvl1/lvl2
(parent_uri = '/top/lvl1'
) 3rd level -/top/top/top/lvl1/lvl2/lvl3
(parent_uri = '/top/top/lvl1/lvl2'
)How to reproduce
Orderable collection's route structure is '/{mount}/{parent_uri}/{slug}' Create nested entries and check uri
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
Possible solution:
src/Routing/UrlBuilder.php