Image

Theme preprocess and suggestions for Drupal 8 Bootstrap sub theme

Building enough Drupal 8 websites I ended up applying always the same basic set of code in my Bootstrap sub theme.

Preprocess hooks are a common way in Drupal to add or manipulate variables that you can use in your Twig templates files.
Suggestions hooks is a common way in Drupal 8 to extend the templates you can use for any part of your code.

Here is a snippet of this, copy this in your theme.theme file and replace MY_D8_THEME by... your theme name!

Comments