AdvancedCustomFields / AdvancedCustomFields/acf
Block Template Overriding
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Hi @elliotcondon,
I am looking for a way / best practice to allow users to override default Block templates come with my ACFBlocks plugin. So, for example, I have a testimonial acf block which has a template comes with my plugin, but I want to let a theme developer/user override the template easily by adding the template file/folder to the theme directory and the testimonial block (or any block) prioritize the theme folder to pick the template instead of one available in the plugin itself.
Any hints/direction would be really helpful.
Note: Also planning to add multiple block styles that may pick different templates, that to be explored. Any hints for that would be great too.
TIA
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the ACFBlocks plugin's block-template loading entry point and how it currently locates templates. Define how a theme template or folder should take priority over the plugin template, and separately assess how multiple block styles could select different templates. Done should include an agreed override convention and documented behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100