0

This is all fairly new to me so I hope i've worded the question correctly.

So I have created a view which outputs a list of news posts, which you can then click on a news post and view the contents of that post. However I've modified the styling of the listings page using the different fields etc. Now I would like to modify the content of the selected news post.

I've created a new template in my templates directory called 'views-views.tpl.php' but that seems to override the content for the listing view landing page as well as the content.

Do I need to use a different template?

If someone could point me in the right direction it would be mostly appreciated.

Thanks.

JDavies
  • 2,730
  • 7
  • 34
  • 54
  • So, you just want to override the template for the full content page (the page you access when you click on an item of your listing)? If yes, you are not in a "view" anymore but in the node.tpl.php. – Djouuuuh Jul 30 '14 at 14:19
  • Yes that's right. Ok so which template do I need to override? Would it be node--news.tpl.php? – JDavies Jul 30 '14 at 14:25
  • Yes, if you need to override only a certain content-type node, that's exactly what you should do. node--news.tpl.php seems perfect to me. – Djouuuuh Jul 30 '14 at 14:30

1 Answers1

1

If you don't mind, I'm gonna give the answer here for more visibility.

When you click on View list item, you actually access the node page. You are not in a View anymore and you should override the node.tpl.php that suits you.

For overriding a content-type "news" node, you can use node--news.tpl.php.

Djouuuuh
  • 1,147
  • 8
  • 16
  • Thank you making that a little clearer, I will give it a try and come back to you. Thanks again. – JDavies Jul 30 '14 at 15:56
  • Another option would be to use the Panels module to create a custom display for your content type. If you don't have any other use for panels it can be overkill, but it is a powerful suite of tools for managing content display. – Quint Jul 30 '14 at 16:07
  • Ok I hope it is what you were looking for :) – Djouuuuh Jul 30 '14 at 16:38