I'm working with panels and views. I'm trying to understand how to create a view and also create a custom template for that view. I'm able to create the view through the Drupal admin and also create the demo.tpl.twig template (using twig, rather than php for templating), but not sure how to tell Drupal to use a specific template for my view.

Any and all help is appreciated. Thanks.


1 Answer 1


You dont need to tell drupal use your template to display output. In your view, click on Theme: Inforamtion (at bottom right), see the file names in Display Output and Style Output section (Last file in both the sections). Create files with same name and save them at sites/all/themes/YOURTHEME/templates directory.

To design whole page use last file from Display Output and to design each row use last file from Style Output. First create and save the files. Then click on Display Output or Style Output, copy the code and paste it respective file. Use your HTML/CSS to design the page. Clear the cache and you will see the result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.