Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/motivation
Drupal themes just ship with hardwired layouts. If users want to apply different layouts to different pages, the theme code needs to be modified. There are solutions working around this whole system by overriding the page rendering and swapping out built-in regions and blocks altogether.
Solution proposal
We should support this use case much better by declaring layouts (and regions per layouts) explicitly within the theme. Then that should allow users to identify which layout to use per page and would need to shift blocks to relate to layouts instead of themes. The proposal is to:
- #1787846: Themes should declare their layouts - Identify layouts from themes either via .info file properties or plugin definitions or .yml config files or an automatic tpl.php discovery mechanism. Possibly also make themes define regions for each layout (although we can probably assume the same regions across all layouts in a theme for now).
- #1839278: Add layout template demonstration - Demonstration of layout templates defined by modules and themes for user review.
- #1841584: Add and configure master displays - Edit master layouts with global blocks
- #1840500: Add simple blank page creation capability - Introduce simple page creation feature with fixed path and block placement.
Comments
Comment #1
Gábor HojtsyOpened #1787846: Themes should declare their layouts for the first point, updating issue summary.
Comment #1.0
Gábor HojtsyUpdated issue summary.
Comment #2
Gábor HojtsyOpened an issue for the UX as well as backend to have layouts assigned to pages at #1787942: Allow assigning layouts to pages.
Comment #2.0
Gábor HojtsyAdded second issue created.
Comment #3
Gábor HojtsyFinally opened #1787956: Make blocks relate to layout instances instead of themes for the last one.
Comment #4
andypostRelated about layouts #1786198: Make consistent regions in code for fields UI overview screens
Comment #5
webchickTagging for Spark.
Comment #6
Gábor Hojtsy#1787846: Themes should declare their layouts got committed! Now work should focus on #1787942: Allow assigning layouts to pages!
Comment #6.0
Gábor HojtsyUpdated issue summary.
Comment #7
webchickI also added #1814520: Create 2 basic sample layouts: 1-col and 2-col. If you know how to write a page.tpl.php, you can help with this issue!
Comment #8
Gábor HojtsyDynamic layouts meta-issue at #1813898: [META] Add editable responsive layouts to Drupal core, which all depend on the issues above to be useful of course.
Comment #9
Gábor HojtsyWorking on implementing more of the designs for blocks and layouts, started #1839278: Add layout template demonstration (and found #1839288: Install profiles cannot provide layouts while working on that).
Comment #10
Gábor HojtsyAlso marked #1787942: Allow assigning layouts to pages postponed since it was deemed to have significant usability problems and created #1840500: Add simple blank page creation capability for simple page creation.
Comment #10.0
Gábor HojtsyUpdated issue summary. Change record should be updated after Twig commited as main template engine
Comment #11
Gábor HojtsyI just created this fascinating little figure about our terminology mash-up, because I got continually confused. Now I have a place to refer and maybe a hope we will fix this all up when the time comes. :D
Comment #12
Gábor HojtsyAlso added #1841584: Add and configure master displays which should complete the minimal buildable pieces we planned to do until Dec 1st.
Comment #12.0
Gábor HojtsyUpdate with new issues
Comment #13
larowlanhey @Gabor, I'm keen to help with the scotch/blocks/layouts initiative from now till feature complete phase, @webchick pointed me this way - can you ping me on irc or use my contact form (or reply here) to point me where you most need help.
Comment #14
andypost@Gabor is there any change for this for D8?
Comment #15
sdboyer CreditAttribution: sdboyer commented@andypost we'll be regrouping on Monday, i think, to answer that question a little better. the simple answer is that they're already decoupled; we'll have to see what we do with the remaining issues in the summary. i haven't been making progress on them because they've been blocked by other things that have needed to come first.
Comment #16
victor-shelepen CreditAttribution: victor-shelepen commentedI've got a lot of information. I am confused. I can not find difference between scotch and spark, spark related projects. I continue to find page builder where I can select an layout and set blocks into the layout. I am crazy. I've started a new project based on Drupal 8. It is a simple catalog. The core possibilities are enough. It is a lack of page manager that likes to panels. I've read a lot but I can not use this information in practice.
Thank you.
Comment #17
Gábor Hojtsy@linkin: Drupal 8 is not ready and it is not suggested you use Drupal 8 for anything than actually developing Drupal 8 itself at this point. Sites you set up now with Drupal 8 will not be capable for example to be upgraded to future Drupal 8 versions (there is not yet a stable API to start the upgrade path from). Unless you actually want to make Drupal 8 better or just want to see and experiment with it, I'd not suggest you use Drupal 8 yet.
Comment #18
victor-shelepen CreditAttribution: victor-shelepen commentedIt is not a big project. I am able to fix it myself. I want to study it better while developing and finding bugs. I am search this compartability. I will report and fix(If I can) this problem. I have got experince with twig extending(template refactoing). They used sand box. Could I apply scotch now? I've not found instructions. I do not see any remote branches. I am ready for problems.
Comment #19
victor-shelepen CreditAttribution: victor-shelepen commentedIt it related project?
http://drupal.org/project/gridbuilder
Comment #20
Gábor Hojtsy@likin: the landing page creation patch as well as the layout exposure patches and the responsive layout builder and gridbuilder modules are outdated and currently not worked on for Drupal 8. If you want to pick them up, get all of them up to speed to Drupal 8, that is of course more than welcome. They are likely in many ways outdated and will not apply to/work with current Drupal 8 core.
Comment #21
victor-shelepen CreditAttribution: victor-shelepen commentedI see the last commit.
Author: Gábor Hojtsy
Date: Thu Oct 18 16:18:17 2012 +0200
It is too late. Is it so bad?
Comment #22
victor-shelepen CreditAttribution: victor-shelepen commentedSorry. I do not know where to write.
I've found this.
Merge branch '8.x-1.x' of git.drupal.org:project/gridbuilder into 8.x-1.x
I see my Drupal branch is old too.
Comment #23
Gábor Hojtsy@link: let's not use this thread as a support channel for all the related projects :) If you want to and can make them work that would be fabulous, however do not expect them to work out of the box without considerable coding to update them. Any change suggestions on the individual project issue queues are welcome!
Comment #24
webchickThis looks like D9 material at this point.
Comment #25
Gábor HojtsyWe need an issue to remove layout module from core, dont we? What do you think @webchick?
Comment #26
webchickI think @gaborhojtsy needs to go back on vacation and away from the computer! :D
Dries made that suggestion at #1978910-62: Convert layout_page_view to a Controller, though EclipseGc requested at #1978910-66: Convert layout_page_view to a Controller that we keep the module in until closer to release, in the hopes that some of the SCOTCH code they're working on will a) be able to be added to D8 still, and b) can make use of it.
But I do think it's doubtful that we'll get any UI built for Layout module in D8 core when the plumbing parts still aren't there, so that's why I moved this to D9. I'm cool being told I'm wrong.
Comment #27
mtiftOn a related note, I'm not sure that https://drupal.org/node/1813372 is still valid, especially now that Twig is in core
Comment #27.0
mtiftRemove cruft.
Comment #28
dasjoMore recent info can be found here:
https://www.drupal.org/project/layout_plugin
#2296423: Implement layout plugin type in core
Comment #29
catchWorth exploring what we can do with this in a minor release.
Comment #30
andypostComment #31
andypostComment #47
catchMoving to a plan.
Comment #48
larowlanWe have layout_discovery in core - modules can define layouts, and they are plugin based - do we still need this?
Comment #49
catchI think this is all very outdated, not surprising since it's from 2012, but #1841584: Add and configure master displays is looking at full-site-chrome use cases which still aren't covered by layout builder, maybe there are duplicates talking about replacing block module somewhere?
Comment #50
andypostElsewere could be found https://www.drupal.org/project/lb_everywhere but panels everywhere still work