Drupal 8: Add a class to the more link of a view.
/**
* Implements template_preprocess_views_view()
/**
* Implements template_preprocess_views_view()
I was trying to theme a specific vocabulary and a specific view mode and the suggestions, by default, didn't allow for this. After some searching I came across this article, which mentioned using the hook:
hook_theme_suggestions_HOOK_alter().
So, I added the function below in my .theme file to make the following template suggestion available: 'taxonomy_term__VOCABULARY__VIEW_MODE'
I needed to add a 'button' class to a file field link and ran into the following issue:
https://www.drupal.org/node/2575427
I was unable to alter the actual anchor within the twig template. So, to workaround the issue, I added the following code to my .theme file.
Adding placeholder text to a Drupal 8 form element that is the label of the form can be done in your .theme file with the hook template_preprocess_input().
I ran into an issue today where I needed to get a themed views title from within a views row style template file (tpl). I tried using drupal_get_title() and menu_get_item() but the title elements were all blank for these. Next I inspected the $views object looking for the themed title but it was not listed. Finally, I discovered within $views->build_info the title and substitutions variables.