Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page preprocess pro layout builder #8

Open
jcerveny opened this issue Nov 16, 2020 · 1 comment
Open

Page preprocess pro layout builder #8

jcerveny opened this issue Nov 16, 2020 · 1 comment

Comments

@jcerveny
Copy link

Ř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()); } } }

@jcerveny
Copy link
Author

jcerveny commented Nov 16, 2020

na úrovni page preprocessu by se dalo otestovat i použití vlastních templates pro LB.

if (substr($layout->id(), 0, 8) === 'section_') { ... }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant