Skip to content

Commit

Permalink
Merge pull request #622 from UN-OCHA/RWR-367
Browse files Browse the repository at this point in the history
fix: Heading paras only output link on main content area of LP
  • Loading branch information
rupl authored Sep 19, 2023
2 parents e426297 + 8a24576 commit 804a47e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ function common_design_subtheme_theme_suggestions_fullcalendar_alter(array &$sug
*/
function common_design_subtheme_theme_suggestions_paragraph_alter(&$suggestions, $variables) {
$paragraph = $variables['elements']['#paragraph'];
$parent = $paragraph->getParentEntity();
if ($parent) {
$suggestions[] = 'paragraph__' . $parent->bundle() . '__' . $paragraph->bundle();
$parent_entity = $paragraph->getParentEntity();
$parent_field_name = $paragraph->parent_field_name->value;

if ($parent_entity) {
$suggestions[] = 'paragraph__' . $parent_entity->bundle() . '__' . $paragraph->bundle();
}
if ($parent_entity && $parent_field_name) {
$suggestions[] = 'paragraph__' . $parent_entity->bundle() . '__' . $parent_field_name . '__' . $paragraph->bundle();
}
}

0 comments on commit 804a47e

Please sign in to comment.