Resources
Fully functional D8 theme
A fully functional Drupal 8 theme which includes all code in this training can be downloaded from github.
Drupal
Twig Field Value module
Twig Tweak module
Managing images in large scale websites (screencast)
Layout Builder
Twig
Twig for Drupal 8/9 Development (Part 1 & 2)
JavaScript
JavaScript30 (Video course by Wes Bos)
Blog Posts/Tutorials
Screencasts/Video Tutorials
Tools and Utilities
Snippets
Create hook alter for user template suggestons
/**
* Implements hook_theme_suggestions_user_alter().
*
* An array of alternate, more specific names for template files or theme
* functions for users.
*/
function training_theme_theme_suggestions_user_alter(&$suggestions, $vars, $hook) {
// Define the view mode.
$mode = $vars['elements']['#view_mode'];
// Create a theme hook suggestion which has the view mode name in it.
$suggestions[] = 'user__' . $mode;
}
Fixing 403 Forbidden error in Pattern Lab
Create an
.htaccess
file in the root of your theme with the following code: (Some have reported the file should be inside thepatternlab
directory. Try the theme's room first and recompile your theme).<FilesMatch "\.(twig)$"> <IfModule mod_authz_core.c> Require all granted </IfModule> <IfModule !mod_authz_core.c> Order allow,deny Allow from all </IfModule> </FilesMatch>
Last updated
Was this helpful?