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

How to style fields within paragraph bundles? #85

Closed djzwerg closed 3 years ago

djzwerg commented 3 years ago

I want to style the output of [field_title] to a heading (h2) so I tried this:

<div class="<?php print implode(' ', $classes); ?>"<?php print backdrop_attributes($attributes); ?>>
  <div class="content"<?php print backdrop_attributes($content_attributes); ?>>
    <h2><?php print render($content['field_ueberschrift']); ?></h2>
    <?php print render($content['field_inhalt']); ?>
  </div>
</div>

but it doesn't work. Maybe it is a duplicate of https://github.com/backdrop-contrib/paragraphs/issues/37?

djzwerg commented 3 years ago

Oh just my fault. I missed the second "-" in the filename (paragraphs-item--text_formatiert.tpl.php)

laryn commented 3 years ago

@djzwerg Glad you got it sorted. You can also use Field Wrappers for a non-code solution.