The Drupal8 base theme classy have allmost all templates inside of it, that means alot of template files, that can be very confusing to figure out where each template is.
How do we sort the templates inside of classy - what are the ruleset for this.
Waypoints & principles to guide us: https://www.drupal.org/node/2008464#principles
concensus banana background.
There is 2 base concepts (if we set it a bit hard up against eachother)
1. Group by "modulename"
This approach is gonna mimic what core does, and makes it easy where template's goes
Copy the same structure as core/module/ does & be done with it.
This is where classy is now after the big move of system templates.
- pro: makes it clear from core, where a template goes
- con: a big system folder & some module names dont always makes so much sense for the themer
- example: Look in core/themes/classy/templates
2. Group by "Themer understanding"
This approach is to group templates based on a common "themer understanding" of which folder a template should be grouped into
- Pro: makes for a better themer experience, as classy is categorized in a more logical way, looked from the themers perspective.
- con: no clear rules for where things go, its basically a judgement call - dont follow core.
- example: Look at screenshots under usecases
Common Theming Usecase:
- the role of classy (to seperate markup & classes out of core), the clean version of the templates are in core/[modulename]/[template] - this is the result of the concensus banana.
- Figuring out where a template is you do with the new awesome theme debug tool (viewsource)
1. Themer basethemes classy
Themer use base theme: classy in themename.info.yml file, only copy's templates files over as its needed.
3. Themer basetheme bartik/seven
Themer uses bartik / seven as a base, copies templates to local theme as its needed.
2. Themer clones classy
Clones all of classy to /theme/classy renames it and gets to work.
Themer have all of Drupals (cores) templates & can change whats needed for the theme.
3. themer dont care about classy
Themer dont care uses the templates directly from core an build's the theme "moreclassy"
Proposed resolution(s) for "group by theming understanding"
- Folder names are singular (node, block, form not nodes, blocks, forms etc)
- No nested folders:
- Templates are grouped "logically": all form elements into one folder, all node things into one.
- Common sense wins over the system. Classy is build for themers, not the machine.
The issues is there isnt a clear ruleset - Theres a lot of judgement calling :/
That can be an issue, when we move views & maybe the rest of admin templates from system over (all depending on those issues) that can create many disucssions.
Get concensus on a set of rules for classy - timeboxed for Drupalcamp London 2015 28 feb.
Or come up with a third solution that might be better ?
Screenshots Folder structure comparison
The screenshots are from 28 feb 2015. The
"group by theming understanding" screenshots
"group by module" screenshots
none but templates will change places.
Original report by @davidhernandez
In the phase 2 process of moving templates to Classy, we are going to put all the templates in the root of the templates folder. Once that is done, we may want to organize them into subfolders. This is a place to discuss that.
If a method for organizing the templates is agreed to, we can make the move in one patch.
Beta phase evaluation
|Issue priority||Not critical because it is not a bug.|
|Unfrozen changes||Unfrozen because it only changes the location of templates. Templates are not currently frozen.|
|Prioritized changes||The main goal of this issue is to improve themer experience.|
|Disruption||There should be limited disruption. Template path changes would only affect someone extending the template, and the fix is simple.|
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 87,984 pass(es). View
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 87,622 pass(es). View
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch classy-file-structure-195.diff. Unable to apply patch. See the log in the details link for more information. View