Problem/Motivation

#2296423: Implement layout plugin type in core did not add any actual layouts to core

#2796173: Add experimental Field Layout module to allow entity view/form modes to switch between layouts is adding two simple ones, top/bottom and left/right

Panels has shipped with the same 8 layouts since 2009.

Proposed resolution

Add those layouts, as-is

Remaining tasks

Decide where they should live, currently in layout_discovery

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett created an issue. See original summary.

tim.plunkett’s picture

Status: Active » Needs review
FileSize
18.89 KB

Status: Needs review » Needs work

The last submitted patch, 2: 2840832-layouts-2.patch, failed testing.

webchick’s picture

We discussed this issue with @Bojhan, @yoroy, @Dries, and @Gábor today on the Ideas Queue review meeting.

Because the layouts represented here are copying an existing pattern from contrib that seems to have been successful since 2009, this seems like a great starting point for addressing the "must-have." If we decide we want more/fewer later, this is something that could be changed in a subsequent patch. The higher priority would be to improve the user experience of the layout selection (e.g. with visuals) vs. trying to get the list 100% right.

jibran’s picture

IMO these should live in layout module.

naveenvalecha’s picture

Agree with #5 could we keep a sub-module of layout_discovery to keep the layouts?

//Naveen

tim.plunkett’s picture

There is no layout.module, the issue queue component is lying to you.

Eventually layout_discovery.module will go away and everything will live in system.module (since subsystems cannot provide template files).

naveenvalecha’s picture

Eventually layout_discovery.module will go away and everything will live in the system.module (since subsystems cannot provide template files).

Right now there's not any right place to keep it in any module.
1) layout_discovery - getting merged into the system.module after layout_discovery reaches beta and then removed?
2) field_layout: We need to made other modules dependent on it if we'll keep it here
How about a separate module for keeping these layouts? Thoughts?
//Naveen

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.

yoroy’s picture

tim.plunkett’s picture

The designs in #10 are not in scope for this issue.
A new issue should be created, something like "Refine the layout selection UI".
If the proposal is to not add any more layouts to core until that is committed, that's fine.
But that issue would be blocked on #2660124: Dynamically build layout icons based on well formed config, and is not relevant to this issue, which is just about adding new layout definitions.

tim.plunkett’s picture

That said, I like the look! Some concerns to share, but let's do that in a dedicated issue.

yoroy’s picture

Here we go,

tim.plunkett’s picture

Requeued the patch for testing.
One important thing is that "panel" still appears in the markup and CSS, and it shouldn't.

Another is that field_layout now exists and has similar layouts.
These can supersede those, but their approach to the template files is more D8-like.
Compare
core/modules/layout_discovery/layouts/twocol/layout-discovery-twocol.html.twig
with
core/modules/field_layout/layouts/twocol/layout--twocol.html.twig

DickJohnson’s picture

Assigned: Unassigned » DickJohnson

Working on it.

DickJohnson’s picture

Worked a bit on #14.

DickJohnson’s picture

Assigned: DickJohnson » Unassigned
DickJohnson’s picture

I was a bit in a hurry when I submitted the patch, so the replaces all the 'panel' and 'panel-' classes from templates and css-files with layout-discovery prefixed classes. I was a bit unsure about the naming of as good example on 3col 25-50-25 layout about the naming of the 25% parts. In responsive design sidebar is a wrong term and the same applies for narrow-column as all the three columns are probably 100% width on mobile.

Manuel Garcia’s picture

Status: Needs work » Needs review
tim.plunkett’s picture

Assigned: Unassigned » tim.plunkett

Working on this

tim.plunkett’s picture

field_layout.layouts.yml has an @todo pointing at this issue, the plan is to replace those layouts with these.
Also because layout_discovery is temporary and should eventually be merged with system.module, the prefix "layout_" was chosen for the layouts in field_layout.
As such, we should use those here instead of prefixing with "layout_discovery_".

While doing that conversion, I tweaked the new code to closer match what was in core already.

Finally, after a discussion in #layouts with @dyannenova and @mortenson, I'm removing the "non-stacked" layouts and renaming the stacked ones to take their place. The top/bottom regions will collapse if nothing is placed in them, and it makes them much more useful.

Status: Needs review » Needs work

The last submitted patch, 21: 2840832-layouts-21.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
FileSize
2.69 KB
15.26 KB

1) Needed to update names of regions for twocol now that there are top/bottom regions
2) Didn't remove the unused libraries definition, had no idea there was a test for that! Cool.

Status: Needs review » Needs work

The last submitted patch, 23: 2840832-layouts-23.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review

Random failure. According to mixologic "thats aws taking our spot instance away."

xjm’s picture

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

Since layout_discovery and field_layout are alpha experimental modules, this issue should be eligible for 8.3.x according to our experimental module policy.

DyanneNova’s picture

Status: Needs review » Needs work

Right now the columns don't break for mobile widths, they stay at the same percentage width for all screen sizes. That's something we need to fix in Panels too, but probably should fix here before the layouts go in core. I can fix them tomorrow if no one else gets to it first.

DickJohnson’s picture

I was thinking about fixing and cleaning up the whole CSS, but I think that it should be done on separate issue as it might require some conceptual discussion.

DickJohnson’s picture

Reviewed the patch from #23 and it's RTBC from my point of view. It moves five out of eight panels layouts to layout_discovery -module, changes the naming to what has been spoken, it's working and the code has been written according the standards.

Leaving it still to needs work as my previous comment for #27 probably needs other opinions too.

tim.plunkett’s picture

Remember we are adding this to an experimental module, so we can iterate on this over time. Though if it's an easy fix that's great

DyanneNova’s picture

Status: Needs work » Reviewed & tested by the community

Ok, that works. I think it's fine to have a follow up tickets for the CSS. Otherwise, this looks great to me.

tim.plunkett’s picture

Added #2852608: Review layout CSS and markup as a must-have issue on the meta. Thanks!

  • xjm committed 4b3ea19 on 8.4.x
    Issue #2840832 by tim.plunkett, DickJohnson, yoroy, DyanneNova, webchick...

  • xjm committed 822a4a7 on 8.3.x
    Issue #2840832 by tim.plunkett, DickJohnson, yoroy, DyanneNova, webchick...
xjm’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed
Issue tags: +8.3.0 release notes
FileSize
339.04 KB
205.71 KB

@tim.plunkett gave me a mini crash course in Panels layouts to review this. This patch does three things things:

  1. Moves the layouts from field_layout to layout_discovery so they are available to any implementing module. +1!
  2. Adds Panels' layouts, also to layout_discovery, but drops the "stacked" naming convention in favor of simpler names.
  3. Updates the existing twocol template to match the Panels version (adjusting tests as needed), with top and bottom regions available and slightly different CSS:

I agree with having #2852608: Review layout CSS and markup as a must-have followup; thank you for adding that.

Committed to 8.4.x and backported to 8.3.x as an API addition to an alpha experimental module. Also tagging for the release notes; we will mention this on the RC notes and add a small mention of it as a feature of layout discovery in the 8.3.0 release notes. Thanks!

xjm’s picture

Title: Add Panels layouts to core » Add layout templates based on Panels layouts to core

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.