-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
After months of trying to find a workflow that makes sense, today we decided to stop using template-parts altogether, because it makes building themes more work, instead of less work.
Which should be the whole point of using template-parts, making it fast and easy to create pages out of parts. They are not independent of their templates, and not interchangeable without a lot of manual actions (e.g. setting html-element for each and every template). Moreso, using patterns is easier and straigtforward.
Problem
It is a constant fight with setting (and keeping) the html-elements of template-parts, and the editor is not helping.
- The i.e. 'footer' html element has to be manually set when having placed a footer (this makes no sense!).
- We can not specify the html-element for the template-part itself in the editor.
- Instead, we have to add the element for each part in the template where the part is assigned, for each template it is used in (there goes independency out of window).
- Exporting the theme ignores all the elements that are set and all we get is blank div's.
What is the actual problem?
Template-parts should be interchangeable, and totally independent of the template it is placed in. If not, patterns do exactly the same and work seamlessly, and are better designed.
Solution(s)
- Make it possible to set html-element in the template-part itself (in editor template-parts screen).
- Make html-element available per template-part in theme.json
- Remove the dependency on settings in the template where a part is assigned, and save it instead to the template-part.
- Make redundant actions (such as setting 'footer' tag for a footer part) unavailable, to smooth out the workflow.
Crazy idea:
- Deprecate template-parts and add to patterns the ability to wrap them inside an html-element. Which can be easily added in theme.json or via the php file headers.