';
+ $html .= '
';
+
+ if ($tabs !== [] || $actions !== []) {
+ $html .= '';
+ if ($tabs !== []) {
+ $html .= '
';
+ }
+ if ($actions !== []) {
+ $html .= '
' . $renderActions($actions) . '
';
+ }
+ $html .= '
';
+ } elseif ($title !== '' || $description !== '' || !empty($options['show_eyebrow'])) {
+ $html .= '';
+ if (!empty($options['show_eyebrow'])) {
+ $html .= '
' . e($eyebrow) . '
';
+ }
+ if ($title !== '') {
+ $html .= '
' . e($title) . '
';
+ }
+ if ($description !== '') {
+ $html .= '
' . e($description) . '
';
+ }
$html .= '
';
}
- $html .= '';
- if ($tabs !== []) {
- $html .= '
';
+ if ($title !== '') {
+ $moduleTitle = trim((string) ($design['title'] ?? ucfirst($module)));
+ $script = '(function(){'
+ . 'var root=document.querySelector(".home-hero[data-module-name=' . json_encode($module, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . '] .brand-copy h1");'
+ . 'if(!root){return;}'
+ . 'var old=root.querySelector(".module-page-context");'
+ . 'if(old){old.remove();}'
+ . 'root.textContent=' . json_encode($moduleTitle, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ';'
+ . 'var pageTitle=' . json_encode($title, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . ';'
+ . 'if(pageTitle&&pageTitle!==' . json_encode($moduleTitle, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . '){'
+ . 'var span=document.createElement("span");'
+ . 'span.className="module-page-context";'
+ . 'span.textContent=" / "+pageTitle;'
+ . 'root.appendChild(span);'
+ . '}'
+ . '})();';
+ $html .= '';
}
+
$html .= '';
return $html;