This is a sub-issue to #1813898: [META] Add editable responsive layouts to Drupal core
Problem/motivation
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | rlayout-6.patch | 131.74 KB | Gábor Hojtsy |
#6 | interdiff.txt | 5.43 KB | Gábor Hojtsy |
#5 | rlayoutset.test_layout_01.yml_.txt | 950 bytes | nevergone |
#4 | medium_plan.png | 20.3 KB | nevergone |
#4 | medium_result.png | 20.35 KB | nevergone |
Comments
Comment #1
Gábor HojtsyThe proposed patch is feature equivalent to the http://drupal.org/project/layout module.
Comment #2
Gábor HojtsyComment #4
nevergone CreditAttribution: nevergone commentedSome reflection:
I designed a medium width layout:
http://drupal.org/files/medium_plan.png
But after save, the result:
http://drupal.org/files/medium_result.png
Similar the wide layout plan and result:
http://drupal.org/files/wide_plan.png
http://drupal.org/files/wide_result.png
It is not possible to move elements many times between each other:
http://drupal.org/files/some_item_is_not_dragabble_among.png
Comment #5
nevergone CreditAttribution: nevergone commentedAnd the test layout config…
Comment #6
Gábor HojtsyUpdated 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
Comment #7
Gábor HojtsyComment #9
dcrocks CreditAttribution: dcrocks commentedA 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.
Comment #10
Gábor HojtsyWell, 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.
Comment #11
Gábor HojtsyGiven the feature freeze yesterday, this clearly did not happen. Moving to Drupal 9. Watch http://drupal.org/project/layout (or the renamed version rather, given core has now a layout module).
Comment #11.0
Gábor HojtsyAdd image, more notes on remaining tasks
Comment #12
catchNot impossible to do in a minor version, so moving back.