Skip to content

Commit

Permalink
Bugfix: Missing headlines will be displayed again.
Browse files Browse the repository at this point in the history
  • Loading branch information
eki89 committed Dec 17, 2020
1 parent 8e8e077 commit f822187
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Resources/contao/classes/ThemeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ public function extendHeadlineField($dc)
}
}

/**
* Extends the headline field for modules and content elements.
*
* @param $context
*/
public function addHeadlineFieldsToTemplate(&$context)
{
$arrHeadline2 = \StringUtil::deserialize($context->headline2);
$context->headline2 = \is_array($arrHeadline2) ? $arrHeadline2['value'] : $arrHeadline2;
$context->hl2 = \is_array($arrHeadline2) ? $arrHeadline2['unit'] : 'h1';
}

/**
* Extends the headline palette for modules and content elements.
*
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@
'components' => array(),
'componentLists' => array()
));

$GLOBALS['TL_HOOKS']['parseTemplate'][] = array('ContaoThemeManager\Core\ThemeManager', 'addHeadlineFieldsToTemplate');

0 comments on commit f822187

Please sign in to comment.