I have a content type with a paragraph field. That paragraph field has two paragraph fields which I will refer to as subparagraphs.
I want to print one of the two subparagraphs depending on the flag set in the preprocess function.
Paragraph: field_banner_header
Subparagraphs: field_banner_header_single, field_banner_header_multi
Twig:
<div class="callout-options">
{% if callout_options == 'Single' %}
{{ content.field_banner_header[0]['#node'].field_banner_header_single.value }}
{% else %}
{{ content.field_banner_header[0]['#node'].field_banner_header_multi.value }}
{% endif %}
</div>
I have a preprocess hook that stores the value ('Single' or 'Multi') of a bool in callout_options:
function cse_preprocess_node(&$variables) {
$node = $variables['elements']['#node'];
if ($node->getType() == 'unit_landing_page') {
$variables['callout_options'] = $node->get('field_active_callout_tab')->value;
}
}
On page render, I get the following error:
drupal.js?v=8.4.6:13 Uncaught Quick Edit could not associate the rendered entity field markup (with [data-quickedit-field-id="paragraph/426/field_banner/en/default"]) with the corresponding rendered entity markup: no parent DOM node found with [data-quickedit-entity-id="paragraph/426"]. This is typically caused by the theme's template for this entity type forgetting to print the attributes.
I could be wrong, but this seems to be telling me that I am referencing the subparagraph incorrectly.
What is the correct syntax for printing a subparagraph?
{{ kint() }}
and search the output it will give you.