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:

  1. #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).
  2. #1839278: Add layout template demonstration - Demonstration of layout templates defined by modules and themes for user review.
  3. #1841584: Add and configure master displays - Edit master layouts with global blocks
  4. #1840500: Add simple blank page creation capability - Introduce simple page creation feature with fixed path and block placement.

Comments

Gábor Hojtsy’s picture

Opened #1787846: Themes should declare their layouts for the first point, updating issue summary.

Gábor Hojtsy’s picture

Issue summary: View changes

Updated issue summary.

Gábor Hojtsy’s picture

Opened an issue for the UX as well as backend to have layouts assigned to pages at #1787942: Allow assigning layouts to pages.

Gábor Hojtsy’s picture

Issue summary: View changes

Added second issue created.

Gábor Hojtsy’s picture

andypost’s picture

webchick’s picture

Issue tags: +Spark

Tagging for Spark.

Gábor Hojtsy’s picture

Gábor Hojtsy’s picture

Issue summary: View changes

Updated issue summary.

webchick’s picture

I 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!

Gábor Hojtsy’s picture

Dynamic 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.

Gábor Hojtsy’s picture

Working 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).

Gábor Hojtsy’s picture

Also 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.

Gábor Hojtsy’s picture

Issue summary: View changes

Updated issue summary. Change record should be updated after Twig commited as main template engine

Gábor Hojtsy’s picture

I 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

Gábor Hojtsy’s picture

Also added #1841584: Add and configure master displays which should complete the minimal buildable pieces we planned to do until Dec 1st.

Gábor Hojtsy’s picture

Issue summary: View changes

Update with new issues

larowlan’s picture

hey @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.

andypost’s picture

@Gabor is there any change for this for D8?

sdboyer’s picture

@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.

victor-shelepen’s picture

I'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.

Gábor Hojtsy’s picture

@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.

victor-shelepen’s picture

It 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.

victor-shelepen’s picture

Gábor Hojtsy’s picture

@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.

victor-shelepen’s picture

I 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?

victor-shelepen’s picture

Sorry. 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.

Gábor Hojtsy’s picture

@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!

webchick’s picture

Version: 8.x-dev » 9.x-dev

This looks like D9 material at this point.

Gábor Hojtsy’s picture

We need an issue to remove layout module from core, dont we? What do you think @webchick?

webchick’s picture

I 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.

mtift’s picture

On a related note, I'm not sure that https://drupal.org/node/1813372 is still valid, especially now that Twig is in core

mtift’s picture

Issue summary: View changes

Remove cruft.

dasjo’s picture

catch’s picture

Version: 9.x-dev » 8.1.x-dev
Status: Active » Postponed

Worth exploring what we can do with this in a minor release.

andypost’s picture

Status: Postponed » Active
andypost’s picture

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

catch’s picture

Category: Feature request » Plan

Moving to a plan.

larowlan’s picture

We have layout_discovery in core - modules can define layouts, and they are plugin based - do we still need this?

catch’s picture

I 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?

andypost’s picture

Elsewere could be found https://www.drupal.org/project/lb_everywhere but panels everywhere still work