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.

likin’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.

likin’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.

likin’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.

likin’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?

likin’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.