Drupal Answers Asked by wbeasley on October 21, 2020
I am very much so new to Drupal and have moved to this platform after working with Magento for 5 years.
I am trying to create a template for a view. I have created the twig template under /templates/views/ called views-view–partners–partners–sales.html.twig but do not know how to hook the theme into using this twig template.
Inside sites/default/services.yml
add config like this:
parameters:
twig.config:
debug: true
(and clear the cache) and it will turn on twig debug mode, which will give you information (inside html comments in page source) on what templates are used and possible template name suggestions to override those templates.
Answered by MilanG on October 21, 2020
You need to name your template based on the rules for Views templates.
For example, "views-view--partners--partners--sales.html.twig" would mean:
If this is correct, then all you need to do is clear the cache and reload; the template should be picked up automatically.
Answered by Patrick Kenny on October 21, 2020
1 Asked on February 3, 2021 by paul-canning
1 Asked on January 31, 2021 by samay
1 Asked on January 31, 2021 by leif
0 Asked on January 29, 2021 by namit-garg
1 Asked on January 29, 2021 by tonytheferg
1 Asked on January 24, 2021 by rahulkumar-it
1 Asked on January 23, 2021 by emad-karhely
1 Asked on January 23, 2021 by ypcrumble
3 Asked on January 16, 2021 by mpdonadio
2 Asked on January 15, 2021 by lbogdan
1 Asked on January 15, 2021 by j-lucky
1 Asked on January 14, 2021 by bruno-von-paris
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP