You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go as close to the one region setup that made Kalatheme so easy to use
Convert the page.tpl.php to TWIG
Luckily John has converted some of this for another client using Bootstrap theme and some of the leg work is done.
If we need to convert the region blocks, here is anexample of how John did it before:
/**
* Implements hook_preprocess_HOOK() for page.html.twig.
*/
function THEME_preprocess_page(&$variables) {
// Get active theme
$theme = explode("/", \Drupal::theme()->getActiveTheme()->getPath());
$theme = end($theme);
// Load up the site branding block into a var.
// So we don't need to use a region or the block in content.
$brand = Block::load($theme . '_branding');
$variables['branding'] = \Drupal::entityManager()
->getViewBuilder('block')
->view($brand);
// Load up help block, same as above.
$help = Block::load($theme . '_help');
$variables['help'] = \Drupal::entityManager()
->getViewBuilder('block')
->view($help);
// Load up main menu, same as above.
$main_menu = Block::load($theme . '_main_menu');
$variables['main_menu'] = \Drupal::entityManager()
->getViewBuilder('block')
->view($main_menu);
// Load up user / account menu, same as above.
$acct_menu = Block::load($theme . '_account_menu');
$variables['acct_menu'] = \Drupal::entityManager()
->getViewBuilder('block')
->view($main_menu);
}
@soniktrooth close, but we won't ever put code in the .theme except the call to the method within whatever class. Believe this format should be implemented for all future frameworks. So what we need to do is, remove the preprocessPage from the interface and create this in the KalathemeBase class. This way if people need to edit the preprocessPage page, then they can just extend that method and it applies to all frameworks.
Reference: https://www.drupal.org/node/1354#themepreprocess
We need to do two things here:
Luckily John has converted some of this for another client using Bootstrap theme and some of the leg work is done.
If we need to convert the region blocks, here is anexample of how John did it before:
Here is the page.html.twig:
The text was updated successfully, but these errors were encountered: