- Issue created by @alison
- πΊπΈUnited States sethhill
Hi @alison. I ended up hitting a similar issue on a new site. It looks like I had solved it previously using a preprocess hook, like this:
function mymodule_preprocess_paragraph(&$variables): void { /** @var \Drupal\paragraphs\Entity\Paragraph $paragraph */ $paragraph = $variables['paragraph']; $behaviorSettings = $paragraph->getAllBehaviorSettings(); // Set style option behaviors as a logical template variable. if (!empty($behaviorSettings['style_options'])) { foreach ($behaviorSettings['style_options'] as $key => $style) { if (isset($style['property'])) { $variables['style_options'][$key] = $style['property']; } } } }
and then in Twig was able to get at it with
{{ style_options.my_style_option }}
. - πΊπΈUnited States alison
Thanks so much for sharing @sethhill! We've paused on our internal project to experiment with Mercury Editor, but I've got this saved for if/when we finally circle back to that effort (π€π€). And meanwhile, I'll share this with the other person I know who's been experimenting with Mercury Editor.