Contents
What does Hook theme suggestions hook Alter do?
The hook_theme_suggestions_HOOK_alter is a pre-process function that allows us to easily produce custom template suggestions based on an existing hook. For instance, if we wanted to alter the theme suggestions for all of our Pages, then we could use silo_theme_suggestions_page_alter ().
What is theme hook suggestion in Drupal 8?
A theme hook suggestion is an alternate template (.tpl.php) file that you have created to override the base or original template file. For Drupal 8 follows Template naming convention URL.
Where can I find template suggestions in PHP?
Theme debug mode can be used to see possible template suggestions and the locations of template files right in your HTML markup (as HTML comments). To enable it, add this line to your settings.php:
Where to find the suggestion template in Drupal?
The default is to use it for nodes but a suggestion is made for rendering them inside block regions. This suggestion is used by default and the template file is located at “modules/poll/poll-results–block.tpl.php”. See poll-results.tpl.php in the Drupal API documentation for more information.
How to add theme suggestions programmatically for views?
What my idea was is to add a function to my .theme file that would allow me to list display modes for a certain view, and add a single theme suggestion off that back of that. This way I can rename my Twig templates, and re-use the same ones for row and field level, on as many display modes as I’d like.
How to add theme suggestions in Adobe Acrobat Pro?
As I’m not using a theme suggestions alter hook, I’m not sure how I actually add theme suggestions. Obviously I’d need to replace either $suggestion with the correct function to add a theme suggestion, or add a bit at the end of my function to add a theme suggestion based of my $suggestion variable.