Problem/Motivation

Sometimes its required to have more granular control about the column widths used on a specific device size.

Example 1: 3 Column Layout with very long words getting cut off, because of the low default column width on size 'medium'
=> Set Medium to 6/12 or 12/12 columns

Example 2: 3 Column Layout with just icons and a short buzzword, each cell becomes 100% width (12/12 columns), what doesn't look good and allocates to much space
=> Set Small to 4/12, so the icons are stay next each other

So this is a problem in both directions. The default lives somewhere in the middle of those examples.

Example 3: Nested layouts: No matter what the default column widths are, those layouts will break 100%.

Proposed resolution

Add options to override DROWL Layouts column sizes by device size.

The easier way: Equal width for all columns
Required fields:

  • Small Columns
  • Medium Columns
  • Large Columns

The complicated way: Custom width for each column (allows more complex layouts)
Required fields:

  • Column 1
    • Small Columns
    • Medium Columns
    • Large Columns
  • Column 2
    • Small Columns
    • Medium Columns
    • Large Columns
  • Column 3
    • Small Columns
    • Medium Columns
    • Large Columns
  • Column ...

In this case, the column width options should be something like (per Device Size):
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- auto (fill remaining space)
- min-content
- (max-content?)

Remaining tasks

User interface changes

API changes

Data model changes

Comments

thomas.frobieter created an issue. See original summary.

thomas.frobieter’s picture

We already have this "setting per breakpoint" field problem in drowl_paragraphs.
Especially if we choose the more complicated solution here in this issue.. we should consider to find a solution for "dynamic fields" before fixing this. Some kind of Javascript driven forms, which values are stored in a single JSON field (see: https://jsonforms.io/examples/basic or https://jsonform.github.io/jsonform/playground/index.html). Otherwise we will end up in a massive amount of single fields stored in the db.

And to be clear: The JSON settings fields are only meant for those style/layout settings, never for contents, date fields, or something like that.

anybody’s picture

Note to myself:

Removing schema only shifts problems, but doesn't solve them. So yes we might consider that, but then we have to ensure consistency ourselves. Another approach might be to introduce a further field type for this like we did with drowl paragraphs settings.

Anyway, this will need a larger amount of time, we currently don't have.... So this is a note for a later discussion.

thomas.frobieter’s picture

Issue summary: View changes
thomas.frobieter’s picture

This looks really promising to me:
https://www.codimth.com/blog/web/drupal/how-create-dynamic-layouts-using...

Furthermore there is a module: https://www.drupal.org/project/dynamic_layout

If we are also able then to have settings for each of region, this will be become pure, shiny gold.

anybody’s picture

Sadly not even a D10 release for https://www.drupal.org/project/dynamic_layout yet. So we'd need to adopt it then or whatever...
But first we should figure out, what's the most simple and flexible solution here, solving the typical problems...

Another note to ourselves: This would allow us for example to center content in a region, very helpful for providing focused CTA's!

thomas.frobieter’s picture

Another note to ourselves: This would allow us for example to center content in a region, very helpful for providing focused CTA's!

To clearify this point: If the sum of the configured columns are <12/12, its possible to center the whole layout using this option:

thomas.frobieter’s picture

Issue summary: View changes
anybody’s picture

@thomas.frobieter should this be moved over to https://www.drupal.org/project/drowl_layouts_bs/?

thomas.frobieter’s picture

Project: DROWL Layouts » DROWL Layouts for Bootstrap
Version: 4.x-dev » 1.x-dev
Status: Active » Fixed

This is already fixed in BS using Layout Options.

Status: Fixed » Closed (fixed)

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