I am a senior Php developer specialized in Drupal, I offer various services on Drupal development, audits, training and deployment.
You can check and evaluate my work or my modules and feel free to contact me for a quote on any Drupal related project.

Contact me

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