In this following example I will share some code snippets that will attach a custom JavaScript and CSS only to be loaded for a…
drupal 8
Drupal 8 page template suggestion by path alias
Drupal 8 page template suggestion by path alias, here is a snippet that I wrote for adding a couple of extra page template suggestions…
Drupal 8 Preprocess Views View Field
Using Drupal 8 preprocess views view field was a bit tricky so I set up these snippets that should help In your theme’ YOURTHEME.theme…
Drupal 8 view template naming convention
Drupal 8 view template naming convention to make drupal 8 views theming easier.
Drupal 8 add JavaScript and CSS to a page
This is how you add Drupal 8 JavaScript and CSS to a certain page in your custom theme instead of the methods we are…
Drupal 8 change image style on user page
I needed to change image style on the user page, and I also needed to theme some fields. I was able to do everything…
Drupal 8 add icon to block title based on block title
I needed a way for the the block template to decide whether the title needs an icon or not before it. Here is a…
Drupal 8 get node title
For Drupal 8 get node title is not as straight forward as it used to be in Drupal 7. We used to have $title…
Drupal 8 views field templates – naming convention
How to name drupal 8 views view field templates html.twig files. In drupal 7 views we used to have the theming information button in…