This is a sub-issue to #1813898: [META] Add editable responsive layouts to Drupal core


Drupal themes are limited to mostly one specific layout, so site builders opted to use more flexible solutions like Panels that allows people to switch between different layouts for different pages / locations. We have added layouts under #1787634: [META] Decouple layouts from themes to core, which will allow for the selection of layouts, but it is still not possible for site builders to edit layouts on the fly.

Also, today's various output devices require websites to be available with responsive layouts, where a page layout is not fixed to one configuration, but instead depend on how the content should be presented on different devices.

Proposed solution

Drupal core already has breakpoints and grids to offer guides are proposed in #1816650: Add swappable (dynamic) grid systems to core. Finally, a dynamic set of regions are proposed in #1813910: Add region module to Drupal core (for editable responsive layouts). These combined with a user interface to map regions to grids on different breakpoints and exposing those as layouts for the existing layout system provides full flexibility to site builders to create their own layouts.

- Introduce a responsive layout plugin
- Define grids and breakpoints to be used for these layouts (neither module has UIs to make this editable yet)
- Define a default layout to be cloned and edited


Remaining tasks

There are clearly lots of cleanup tasks and opportunities for this patch. Javascript needs to be cleaned up, more support for non-equal-column grids, em based breakpoints. Tests need to be added, and so on and on.

#6 rlayout-6.patch131.74 KBGábor Hojtsy
FAILED: [[SimpleTest]]: [MySQL] 48,054 pass(es), 52 fail(s), and 3 exception(s). View
#6 interdiff.txt5.43 KBGábor Hojtsy
#5 rlayoutset.test_layout_01.yml_.txt950 bytesnevergone
#4 medium_plan.png20.3 KBnevergone
#4 medium_result.png20.35 KBnevergone
#4 wide_plan.png21.09 KBnevergone
#4 wide_result.png23.24 KBnevergone
#4 some_item_is_not_dragabble_among.png13.29 KBnevergone
#2 EditLayout.jpg95.51 KBGábor Hojtsy
#1 rlayout-1.patch134.95 KBGábor Hojtsy
FAILED: [[SimpleTest]]: [MySQL] 46,280 pass(es), 52 fail(s), and 3 exception(s). View


Gábor Hojtsy’s picture

Issue tags:+Spark, +Spark Sprint 7
134.95 KB
FAILED: [[SimpleTest]]: [MySQL] 46,280 pass(es), 52 fail(s), and 3 exception(s). View

The proposed patch is feature equivalent to the module.

Gábor Hojtsy’s picture

95.51 KB

Status:Needs review» Needs work

The last submitted patch, rlayout-1.patch, failed testing.

nevergone’s picture

Some reflection:

I designed a medium width layout:

But after save, the result:

Similar the wide layout plan and result:

It is not possible to move elements many times between each other:

nevergone’s picture

And the test layout config…

Gábor Hojtsy’s picture

5.43 KB
131.74 KB
FAILED: [[SimpleTest]]: [MySQL] 48,054 pass(es), 52 fail(s), and 3 exception(s). View

Updated pages patch to latest core and other changes carried over form similar codebase in #1813910: Add region module to Drupal core (for editable responsive layouts):

- moved rlayout entity to annotated plugin
- renamed delete_confirm to confirm_delete as per core standards
- added an initial short help text
- removed $items init from hook_menu

Gábor Hojtsy’s picture

Status:Needs work» Needs review

Status:Needs review» Needs work

The last submitted patch, rlayout-6.patch, failed testing.

dcrocks’s picture

A nitpick. I know your default layout is just a sample but I was wondering why you define a 'body' region when I thought the drupalism was 'content'. I just thought it confusing to not use a common drupal label and a label in common use as html's 'body' element.

Gábor Hojtsy’s picture

Status:Needs work» Postponed

Well, anyway, due to core things not happening below this layer that we wanted to build on, we just need to go and focus on those things and will pretty likely not have a responsive layout builder (and therefore this module) in core. Unless someone comes and want to run with all these. Start from #1813898: [META] Add editable responsive layouts to Drupal core.

Gábor Hojtsy’s picture

Version:8.x-dev» 9.x-dev
Status:Postponed» Needs work

Given the feature freeze yesterday, this clearly did not happen. Moving to Drupal 9. Watch (or the renamed version rather, given core has now a layout module).

Gábor Hojtsy’s picture

Issue summary:View changes

Add image, more notes on remaining tasks

catch’s picture

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

Not impossible to do in a minor version, so moving back.

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.