Created
March 6, 2019 14:30
-
-
Save kuflievskiy/c59f2d8105c2a925bcdf1accd8fa1e2c to your computer and use it in GitHub Desktop.
Examples theme_suggestions
This file contains 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
<!-- THEME DEBUG --> | |
<!-- THEME HOOK: 'views_view' --> | |
<!-- FILE NAME SUGGESTIONS: | |
x views-view--products-page-products.html.twig | |
* views-view.html.twig | |
--> | |
<!-- BEGIN OUTPUT from 'sites/all/themes/brand_theme/templates/views/views-view--products-page-products.html.twig' --> | |
/** | |
* Function brand_theme_theme_suggestions_views_view_alter | |
* @param object $suggestions | |
* @param object $variables | |
* Function are used for rewrite 'views_view.html.twig' | |
*/ | |
function brand_theme_theme_suggestions_views_view_alter(&$suggestions, $variables) { | |
if ( 'products' != $variables['view']->id() ) { | |
return; | |
} | |
$suggestions[] = 'views_view__products_' . $variables['view']->getDisplay()->display['display_plugin'] . '_' . strtolower( str_replace(' ', '_', $variables['view']->getDisplay()->display['display_options']['title']) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment