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

Template-parts make no sense when they are not independent of its template. #41433

Open
Humanify-nl opened this issue May 30, 2022 · 1 comment
Labels
[Block] Template Part Affects the Template Parts Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Enhancement A suggestion for improvement.

Comments

@Humanify-nl
Copy link

Humanify-nl commented May 30, 2022

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.

  1. The i.e. 'footer' html element has to be manually set when having placed a footer (this makes no sense!).
  2. We can not specify the html-element for the template-part itself in the editor.
  3. 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).
  4. 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.
@kathrynwp kathrynwp added [Type] Enhancement A suggestion for improvement. [Feature] Full Site Editing [Block] Template Part Affects the Template Parts Block labels Jun 14, 2022
@jameskoster
Copy link
Contributor

Make it possible to set html-element in the template-part itself (in editor template-parts screen)

There's an issue for this here: #37220

Crazy idea

I don't think it's too crazy. You may be interested to catch up with discussions in #41717, #34352, and #41379.

@annezazu annezazu added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") and removed [Feature] Full Site Editing labels Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Template Part Affects the Template Parts Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants