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
Yes it is. Open the Views Admin UI and in Theme Information there is a list of available template files
For example in my website it is:
You can use any of them.
-
1But 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.– AmyApr 23, 2015 at 17:38
-
Not at all, As an example
views-view--library-block.tpl.php
is a template file for every block oflibrary
view orviews-view--library-block-1.tpl.php
is a template file for a display block with machine nameblock_1
Apr 23, 2015 at 18:15
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