Skip to content
Marie-Louise edited this page Aug 9, 2018 · 56 revisions

Everything Drupal!!

Theme Hook

Using a Base theme and create a new sub-theme

the child theme is the one which you change to override the base theme

Naming conventions

block--[module]--[delta].html.twig

....

Drupal needs the naming conventions to look for the right template, so for example it will look for a block based on the naming convention.

So it will allow the dev to target this particular block for customisation (similar to how an ID is targeted in styling languages).

Template Directories

Its good practice to separate the templates into different directories also its good practice to use the comments in each file

Nodes Patterns

node--[type|nodeid]--[viewmode].html.twig

Twig naming conventions

to add a function to the second block {{label|upper}}

Clone this wiki locally