$section['style'] === 'hero-links'); $alignments = $page['alignments']; $presentation = $page['presentation'] ?? []; $showBreadcrumbs = !$home && !$shared && !$system; $customCrumbs = array_key_exists('breadcrumbLinks', $presentation); $crumbs = !$showBreadcrumbs ? [] : ($customCrumbs ? SiteDesign::parseLinks($presentation['breadcrumbLinks']) : [['/', '首页'], ['/' . $page['slug'], $page['name']]]); $customHero = array_key_exists('heroHtml', $presentation); $renderManagedHero = !$customHero || $canvas; $style = static fn (string $role): string => CanvasStyle::classes($presentation, $role); $text = static fn (string $role, string $value): string => CanvasStyle::text($presentation, $role, $value); $styleField = static fn (string $role): string => $canvas ? ' data-studio-style-field="' . $role . '"' : ''; $alignField = static fn (string $name): string => $canvas ? ' data-studio-align-field="' . $name . '"' : ''; $field = static fn (string $name): string => $canvas ? ' data-studio-field="' . $name . '"' : ''; ?>
= $styleField('eyebrow') ?>>= $text('eyebrow', $presentation['heroEyebrow'] ?? $site['name']) ?>
= $alignField('lead') ?>= $styleField('lead') ?>>= $text('lead', $page['lead']) ?>
从「组件」添加版式,或在页面设置中显示首屏。
= View::fragment('section', [ 'section' => ['style' => 'plain', 'key' => 'new', 'version' => null, 'title' => '', 'lead' => '', 'body' => ''], 'moment' => false, 'canvas' => true, ]) ?> = View::fragment('section', [ 'section' => ['style' => 'layout', 'key' => 'new-layout', 'version' => null, 'title' => '', 'lead' => '', 'body' => ''], 'moment' => false, 'canvas' => true, ]) ?>