Skip to content

Instantly share code, notes, and snippets.

View mariohernandez's full-sized avatar
✌️

Mario Hernandez mariohernandez

✌️
View GitHub Profile
@anavdesign
anavdesign / drupal-themeing.md
Last active October 13, 2023 02:06
Drupal: Themeing

Drupal Themeing

Using base_path and directory variables in twig template

{{ base_path }}
{{ directory }}
{{ base_path ~ directory }}

@mdo
mdo / 00-intro.md
Last active March 24, 2024 08:04
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@star-szr
star-szr / mytheme.theme.php
Created March 28, 2014 19:33
Adding template suggestions for view modes and content types in Drupal 8
<?php
/**
* Implements hook_theme_suggestions_HOOK_alter() for node.html.twig.
*/
function MYTHEME_theme_suggestions_node_alter(array &$suggestions, array $variables) {
// Add template suggestions based on the current view mode.
$node = $variables['elements']['#node'];
$suggestions[] = 'node__' . $variables['elements']['#view_mode'];
$suggestions[] = 'node__' . $node->bundle() . '__' . $variables['elements']['#view_mode'];
}