Drupal 6.9, views 6.x-2.3

I created a sub theme of marinelli in a sibling directory... Then for my event content type I wanted to
create a custom node template, so I made a copy of the node.tpl.php in the marinelli dir as node-event.tpl.php
in my sub theme directory... After clearing my cache, the system was still using the default template to render
the Event nodes. Later I discovered that if I moved my custom node template to the marinelli directory, then
the custom template was picked up..

This is different from my custom views template, when I create custom templates in the views subdirectory
of my sub theme and rescan the template files, the correct template is picked up from my sub theme..

Comments

jdsaward’s picture

I was experiencing the same difficulty with a sub-theme of Acquia Marina.

I found that once I duplicated the default node.tpl.php file from the Acquia Marina directory, into my sub-theme directory, then the node-type-specific file (in my case node-biblio.tpl.php) is picked up from the sub-theme.

That is, in the sub-theme directory you need a node.tpl.php file as well as node-event.tpl.php.

John Gentilin’s picture

JDSaward , thank you for the tip... your solution worked for me too...

although to pull node.tpl.php into my sub theme takes a chunk out of the significance
of having a base theme.. might as well take a copy of my base theme and edit that..

-John G

niklp’s picture

This is a limitation of the phptemplate engine system under Drupal 6. It may be fixed in Drupal 7, I'm not sure.

damienmckenna’s picture

While some of this can be simplified by using symlinks, it is a bug, makes subthemes definitely less useful, and needs to be fixed.

turadg’s picture

Title: custom node template not selected for sub themes. » custom node template ignored in sub themes

I agree with Damien. Any chance this will be fixed in D7?

In the meantime, at least some mention of this in the docs would be helpful. I got here from some helpful comments, but this gotcha should be in the main text.

http://drupal.org/node/225125

recidive’s picture

Project: PHPTemplate » Drupal core
Version: master » 8.x-dev
Component: Template Defaults » theme system

I don't know if this was fixed in Drupal 7 but this is certainly in the wrong project.

Is this a bug or a feature request? If it's a feature, I think it's too late for 7, if it's wasn't fixed.

damienmckenna’s picture

This is definitely a bug.

recidive’s picture

Version: 8.x-dev » 7.x-dev

Ok, moving to 7.x to see if this is acceptable there or if this happened to be fixed already.

jon nunan’s picture

Status: Active » Closed (duplicate)