[support] Overriding page.tpl.php for node type...

Scott Matthews smatthews at optaros.com
Fri Apr 10 15:48:57 UTC 2009


So I've received a lot of great suggestions ... I've got one more to try before I can say I've tried them all.  It seems I may not have fully explained everything I've done so that everyone is on the same page.


I enabled CCK and created a new content type (call it testtype for example) that I wish to theme.

I created new content for that type so it shows up on my default screen

I created a template node-testtype.tpl.php based on the node.tpl.php and modified that new file to make sure that my testtype was being interpreted by it.  It was, so the node template override works.

The difficulty I've still had is creating a page dedicated to that type to show only that type and themed accordingly


 *   I've created a page page-testtype.tpl.php
 *   I've modified my template.php adding the function "_phptemplate_variables" with suggestions I've found here
 *   Each change was tested after clearing the cache to reset the registry

None of these worked for me.  Now based on the online manual, and a reminder by one responder, it seems like this approach SHOULDN't work out of the box ( http://drupal.org/node/190815) but users here, and co-workers, have seen it work so if anyone has any suggestions of what I might be missing do do what I wish to do, I'd appreciate it.


And I wish to say again that I really appreciate all the attempted help that I've received so far!!!



On 4/10/09 11:19 AM, "Michael Prasuhn" <mike at mikeyp.net> wrote:

On Apr 10, 2009, at 6:24 AM, Scott Matthews wrote:
> I'm not sure I understand your question?  I'm not using path auto or
> views.  I'm just typing in the URL:
>
> http://localhost/type
>
> And looking to access the page
>
> Page-type.tpl.php

You need to have a node created in Drupal first, with the path 'type'
before you can create a template for the node-type. You can add node
types to your site at admin/content/types. Alternately you could
create a new node, review the URL when you are done and if it is
example.com/node/1, then you could use the template page-
node-1.tpl.php for that node.

-Mike

__________________
Michael Prasuhn
503.488.5433 office
714.356.0168 cell
503.661.7574 home
mike at mikeyp.net
http://mikeyp.net





--
[ Drupal support list | http://lists.drupal.org/ ]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/support/attachments/20090410/07db8fc2/attachment.htm>


More information about the support mailing list