This question already has an answer here:
- How to print paragraphs in twig template 6 answers
I'm using Drupal 8.5.4 and Bootstrap Paragraphs. I have a custom module
foo and a custom paragraph type
bar defined within. In the template for
bar, I use
kint to inspect the content of the variable. It turns out it has 17 properties, and none of them are the value of the field. The first 14 of them are in core/lib/Drupal/Core/Field, L#89-102. The last 3 are
Digging into the object, I found the field value in
content.bar.0['#context'].value. Obviously using this method to access a simple field value is janky as hell, and I would prefer not to have to do this every time.
- Is there a simpler way to access the field value? I don't mind using a twig filter if need be
- Is there a way to configure my paragraph types to pass the context to the template, rather than all of the field data?