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
| Comment | File | Size | Author |
|---|
Comments
Comment #2
thomas.frobieterWe 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.
Comment #3
anybodyNote 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.
Comment #4
thomas.frobieterComment #5
thomas.frobieterThis 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.
Comment #6
anybodySadly 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!
Comment #7
thomas.frobieterTo clearify this point: If the sum of the configured columns are <12/12, its possible to center the whole layout using this option:

Comment #8
thomas.frobieterComment #9
anybody@thomas.frobieter should this be moved over to https://www.drupal.org/project/drowl_layouts_bs/?
Comment #10
thomas.frobieterThis is already fixed in BS using Layout Options.