0

I needed to edit the views-view-unformatted.tpl.php for a specific view, however I'd rather it not apply to every view. Is there a possible way to make a unique view template to select from? Rather than rewriting every view that uses views-view-unformatted?

2 Answers 2

1

Yes it is. Open the Views Admin UI and in Theme Information there is a list of available template files

enter image description here

For example in my website it is:

enter image description here

You can use any of them.

2
  • 1
    But editing those templates would have me run into the same problem. Any view that used those templates would be overwritten. I'm wondering if it's possible to make a template unique to one specific view.
    – Amy
    Apr 23, 2015 at 17:38
  • Not at all, As an example views-view--library-block.tpl.php is a template file for every block of library view or views-view--library-block-1.tpl.php is a template file for a display block with machine name block_1
    – M a m a D
    Apr 23, 2015 at 18:15
1

You can copy 1 of the default templates provided by views (the source code is in the /views folder) into a template file named specifically for that 1 view.

This is explained in this other answer: https://drupal.stackexchange.com/a/11472/3279

Your Answer

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

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