Skip to main content
added 30 characters in body
Source Link
xcono
  • 11
  • 2

It's because you operateyou're operating a field, but not ana paragraph entity. In the preprocess hook you can get specific paragraph field view, like this:

$paragraphField = $paragraph$variables['paragraph']->get('field_role');
$variables['content']['field_role'] = $variables['paragraph'];$paragraphField->view();

Then render in field template:

{{ content.field_role }}

It's because you operate a field, not an paragraph entity. In preprocess you can get specific paragraph field view, like this:

$paragraphField = $paragraph->get('field_role');
$variables['content']['field_role'] = $variables['paragraph'];

Then render in field template:

{{ content.field_role }}

It's because you're operating a field, but not a paragraph entity. In the preprocess hook you can get specific paragraph field view, like this:

$paragraphField = $variables['paragraph']->get('field_role');
$variables['content']['field_role'] = $paragraphField->view();

Then render in field template:

{{ content.field_role }}
added 211 characters in body
Source Link
xcono
  • 11
  • 2

It's because you operate a field, not an paragraph entity. In preprocess you can get specific paragraph field view, like this:

$paragraphField = $paragraph->get('field_role');
$paragraphFieldView$variables['content']['field_role'] = $paragraphField->view();$variables['paragraph'];

Then render in field template:

{{ content.field_role }}
$paragraphField = $paragraph->get('field_role');
$paragraphFieldView = $paragraphField->view();

It's because you operate a field, not an paragraph entity. In preprocess you can get specific paragraph field view, like this:

$paragraphField = $paragraph->get('field_role');
$variables['content']['field_role'] = $variables['paragraph'];

Then render in field template:

{{ content.field_role }}
Source Link
xcono
  • 11
  • 2

$paragraphField = $paragraph->get('field_role');
$paragraphFieldView = $paragraphField->view();