Last active
January 5, 2019 15:25
-
-
Save mherchel/42a8cff0e27620007bc918ece801b0df to your computer and use it in GitHub Desktop.
Strip extraneous divs from field templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for item in items %} | |
{{ item.content }} | |
{% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_theme_suggestions_alter(). | |
*/ | |
function YOURTHEMENAME_theme_suggestions_alter(array &$suggestions, array $variables, $hook) { | |
if ($hook === 'field') { | |
switch ($field_name) { | |
case 'field_bio_media': | |
case 'field_media_image': | |
case 'field_hero_media': | |
case 'field_promo_media': | |
case 'field_episode_guests': | |
case 'field_show_hero_background_image': | |
$suggestions[] = 'field__bare'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment