Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Columns and classes attributes in paragraphs.grid_layouts.yml are currently required because if we don't define them we will get PHP errors. But in multiple places, we have a need to just define grid layout style which is more a simple layout style and it's not actually a full grid style.
For example instead of
design_theme_centered:
title: 'Centered'
description: 'Centered.'
wrapper_classes:
- text-center
columns:
-
classes:
-
it would be nicer that we are able to just define:
design_theme_centered:
title: 'Centered'
description: 'Centered.'
wrapper_classes:
- text-center
Proposed resolution
Improve checkings in PHP so the code can allow this.
Remaining tasks
Do the patch and discuss the proposed solution.
Comment | File | Size | Author |
---|---|---|---|
#2 | dont-require-columns-and-classes-2923977-2.patch | 900 bytes | pivica |
|
Comments
Comment #2
pivica CreditAttribution: pivica at MD Systems GmbH commentedHere is a patch.
Comment #3
Primsi CreditAttribution: Primsi at MD Systems GmbH for MD Systems GmbH commentedI think it makes sense. Maybe we want to test that case. Probably it can be added to the test layouts yml file and then tested.
Comment #4
pivica CreditAttribution: pivica at MD Systems GmbH commentedTest make sense will add it.
I know we are stretching a definition a here a bit but from our previous discussion:
Comment #5
pivica CreditAttribution: pivica at MD Systems GmbH commentedHowever it also makes sense to split this to Layout and GridLayout - then we allow a user to combine this two things - maybe he wants 50% centre (layout) and two columns (grid layout)... But not sure do we need that kind of flexibility or current approach is enough.
Comment #6
miro_dietikerYeah, definitively we need an example layout that uses this new feature. Then it's easy to use it and check if it works.
Comment #7
BerdirFine without an example for now, it's just adding a check.