Skip to content
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

Ensure WordPress template hierarchy is intact for hybrid themes #390

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

ssang
Copy link
Contributor

@ssang ssang commented Jul 18, 2024

While working on a theme with the changes from #382 in place, I realized the issue was greater than just where the index.php file is placed in the hierarchy. Currently FSE templates are intentionally prioritized over blade templates, but we lose the WP Template hierarchy.

If we take a look at a Product CPT, this would be the template hierarchy that is currently in place.

image

As you can see, no matter how specific of a blade template file I create, it will never be prioritized over a single.html file in the templates directory. For hybrid themes, templates need to first be grouped by the file slugs with the FSE templates prioritized within those groupings.

This would be the result

image

@Log1x Log1x merged commit c1c2f57 into roots:main Aug 12, 2024
1 check passed
@Log1x
Copy link
Member

Log1x commented Aug 12, 2024

Thank you!

@ssang ssang deleted the fse-group-templates branch August 12, 2024 15:55
@andronocean
Copy link

Is it possible to get this into a 4.x release while we wait for Acorn 5? This is a persistent hassle for hybrid themes — index.html taking precedence over home.blade.php puzzled me to no end a couple months ago, and just bit me again on another project.

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.

3 participants