backdrop-contrib / paragraphs

Paragraphs module to control your content flow
https://backdropcms.org/project/paragraphs
GNU General Public License v2.0
5 stars 11 forks source link

`paragraphs-item.tpl.php` should use $classes_array rather than $classes #108

Closed argiepiano closed 2 years ago

argiepiano commented 2 years ago

Entity Plus places all custom entity css classes in the variable $classes_array. The template should use that variable, rather than the more limited $classes variable (which only contains one css class: 'entity-plus'). The $classes_array variable contains css classes entity-paragraphs-item and paragraphs-item-{bundle}.

This will change the markup from this:

Screen Shot 2021-12-04 at 12 17 39 PM

TO THIS:

Screen Shot 2021-12-04 at 12 17 21 PM

Making it easier to theme individual paragraph items with css.

This change is the result of the removal of the theme process layer. When porting this module from Drupal, the classes were correctly flattened with implode, BUT the wrong variable was used ($classes). (We will also need to modify the doc block with variables explanations in the template file).

PR coming

argiepiano commented 2 years ago

After submitting the PR I realized that you are using $classes to also add the modal css classes in that template. Let's put this issue and PR on hold while I take a look at an alternative proposal.

laryn commented 2 years ago

@argiepiano We can adjust that to use the $classes_array as well, perhaps? That feature is still in alpha and hasn't been formally released.

argiepiano commented 2 years ago

I'm going to try a few different things now and will report back.

I have been "bitten" in the past by the fact that Entity Plus does not invoke the template_preprocess_xxx for custom entity template files, which is, in my view, at the crux of the problems with Paragraphs, and the reason for imperfect solution of using a #theme_wrappers to force a call of template_preprocess_paragraph_item(). I'm going to try an alternative.