Best practices for Template parts organisation


I am currently working on the revamp of my starter theme and some documentation and I was wondering if you have any good examples of template parts structure?

I have checked what the core team does with the twenty themes but it is always pretty simple.

I usually use the following prefixes but this might not be the best option:

  • content- for full content pages;
  • section- for section of content;

Then I have a components folder for every other components with special prefixes like:

  • card- for small cards elements;
  • form- for form elements;
  • button- for buttons;
  • loop- for loops;
  • nav- for navigation elements;
  • video- for videos;

It’s not perfect as sometimes a section could be just a loop. That’s why I am looking for examples of best practices.

Thanks for your help!

Pipo 5 months 2022-07-21T10:01:37-05:00 0 Answers 0 views 0

Leave an answer