Drupal 7 Views - customize RSS output template
I have RSS feed of custom type news items in Drupal 7 using Views module. Created views-view-row-rss.tpl.php in /mytheme/ directory and in "Edit view" "Theming information" Row style output: views-view开发者_StackOverflow社区-row-rss.tpl.php shows that template was found in my themes directory. Problem is, that this template is not used, RSS feed is always generated using default template. And clicking on Row style displays default template. How to force Views module to use my custom template?
You should put a specific filename like what you see in the theme info in views. Say for example if you have a 'sales' feed as view.
The template files according to theme information: views-view-row-rss--sales--feed.tpl.php views-view-rss--sales--feed.tpl.php
Make sure to flush your cache and put the files in your templates folder. ex. themes\custom\mytheme\templates
Don't use views.
Use EntityFieldQuery and pass the nids to node_feed.
EFQ is VERY easy to use. Here are a couple of tutorials.
The correct location for views templates is sites/all/themes/mytheme/templates/views/
Move it there and run a full cache flush and you should see it.
精彩评论