Skip to content

[6.x] Fix custom term templates on collection-scoped term URLs - #15351

Merged
jasonvarga merged 1 commit into
6.xfrom
custom-term-template-for-collections
Sep 2, 2026
Merged

jasonvarga merged 1 commit into
6.xfrom
custom-term-template-for-collections

Conversation

@duncanmcclean

Copy link
Copy Markdown
Member

This pull request fixes an issue where setting a custom term template on a taxonomy (eg. term_template: taxonomy/term) caused collection-scoped term URLs like /blog/tags/foo to 404, while /tags/foo and /blog/tags continued to work.

This was happening because LocalizedTerm::template() always prefixed the taxonomy's term template with the collection handle when the term was scoped to a collection, producing blog.taxonomy/term. That view never exists, so the view()->exists() check in toResponse() failed. The taxonomy index didn't have this problem since Taxonomy::template() already returns a custom template as-is.

This PR fixes it by only adding the collection prefix when the taxonomy is using its conventional default term template, so a custom term_template is used as-is for both /tags/foo and /blog/tags/foo.

Fixes #10478

@jasonvarga
jasonvarga merged commit 862799b into 6.x Sep 2, 2026
65 checks passed
@jasonvarga
jasonvarga deleted the custom-term-template-for-collections branch September 2, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom template on a taxonomy breaks the collection-taxonomy pages

2 participants