-
-
Save waako/22856e7f1c7125508fc0448217f7f1c7 to your computer and use it in GitHub Desktop.
Get paragraph type of child field item
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_preprocess_HOOK for field--field-structured-content-section.html.twig | |
*/ | |
function TEMPLATE_preprocess_field__field_structured_content_section(&$variables) { | |
$items = $variables['items']; | |
foreach ($items as &$item) { | |
$paragraph = $item['content']['#paragraph']; | |
$para_type = $paragraph->getType(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment