Skip to content

Page preprocess pro layout builder #8

@jcerveny

Description

@jcerveny

Řešil jsem problém s použitím LB v page.html.twig
Kolega Petr Okurek mě navedl k tomuto řešení, které funguje pěkně:

function csgov_theme_preprocess_page(&$variables) { if (isset($variables['node'])) { if($variables['node']->hasField('layout_builder__layout')) { $variables['has_page_layout'] = !empty($variables['node']->get('layout_builder__layout')->getSections()); } } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions