2

Ok so my problem is this, I want to be able to manage events in a simplistic form on a Drupal 7 site. I created the relevant content type and inserted some dummy content, all is well. I then move on to creating views for displaying this in various forms (1 view for forthcoming events, 1 view for archived/past events). Again these seem to work fine. Now the problem comes when I want to display the views for this content type on the pages for this content type, so you go to an individual event page and you're presented with the relevant information followed by a views block for forthcoming events and a views block for archived events. I've created three templates, one for the content type (node--type.tpl.php) and one for each of the views (node--view--view-name.tpl.php) but the default one is getting overridden on the node page by the what appears to be the last loaded views one. I thought that these were specifically for the views not the default node display for that content type.

Now I am probably just missing something (I'm relatively new to Drupal, I've read through the theming guide and tried searching for similar issues, only managed to find 1 from 2007 which wasn't very helpful, but I've only been using it for the last 2 weeks) but I would like to know why this does this and how to stop it.

Hope this is enough information

Edit: I'm using the latest versions of the following in this: Drupal 7, Views Module, Date Module.

  • have your tried "debugging" this with the theme developer? – nonsenz May 26 '11 at 16:49
  • Yes, I'm using Devel with the Theme Developer, I am checking the template suggestions and I just don't get why node--view--view-name.tpl.php is overwriting node--type.tpl.php when views are being displayed on that page. If I remove the views blocks from that page it displays using the correct node--type.tpl.php. – pmells May 27 '11 at 8:20
  • How are you including the views on the node page? That could have a bearing on how the templates are decided. – Jeremy French May 27 '11 at 14:53
  • I'm just displaying them using Drupal's block management. The block is created by views (obv. (= ), then I'm setting said blocks to only display on certain pages. I would like to say that I have sort of have solved my problem by using the template node--view--view-name--block.tpl.php but I would still like to know why one template overwrites the other when the other is not anything to do with views. – pmells May 27 '11 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.