Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Waen on
Hi!
Where to place core/modules/views/templates/views-view-field.html.twig to overide it? I use bootstrap module so i tried with different names inside themes/bootstrap/templates/views but no one worked. Do I put it in the right directory? I tried to follow the naming convention like views-view-field--view_books_list--field_book_name.html.twig and some others but without any result. (My view has the view machine name view_book_list). Do you have an idea that would help me?
Thanks.
Comments
Enable twig debug
First of all enable twig debug and you can see correct twig templates names in web console. See here how do this:
https://sqndr.github.io/d8-theming-guide/twig/twig-debug.html
in console you see something like this
And you can choose one of templates name. Usually fields templates add to THEME_DIR/templates/field. If you go to the bootstrap/templates/fields you find fields twig templates in the directory and you can use necessary twig template name for your template. But put file into your theme template.