[themes] changing page template based on node type from within template.php

John Haas john at manapedesign.com
Thu Jun 8 19:39:30 UTC 2006


Hi folks,

I'm trying to serve a specific page template for all nodes that are 
forum posts.

As of right now, I've been twiddling in template.php to do similar 
work... serve different templates based on url arg().

Here's the function I'm using: http://pastebin.com/767797

Note that I've been trying to grab the node type /(if (arg(0) == 'node' 
&& is_numeric(arg(1)))/ and then trying to load a page template based on 
that: /elseif ($node->type == 'forum') {/

I thought this was the proper way to do this, yet now I'm getting some 
scary looking mySQL errors (linked so I don't have to paste them in here):
http://qatotonetwork.newmbc.com/node/1110

Would appreciate some help if anyone has a clue what I'm doing wrong 
here.  Thanks in advance!

-John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: john.vcf
Type: text/x-vcard
Size: 222 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/themes/attachments/20060608/14a1c94a/john.vcf


More information about the themes mailing list