[support] Display Node with Template

Fred Jones fredthejonester at gmail.com
Wed Jan 27 13:06:59 UTC 2010


I have a site with a custom content type called Class. We have a file
in the theme called node-class.tpl.php.

Now the challenge is that we have need a URL like /featured_class
which will search based on a boolean CCK and randomly select any class
node which is marked as "Featured" and then display that.

I can do this with SQL and then redirect to the class node, but then
the URL changes to that of the node. They want the URL to stay the
same, ie. featured_class.

I can't wrap my head around this. I somehow need to get the
node-class.tpl.php in there b/c there's a lot of code in there for
displaying classes. The only solution I have thus far (that someone
else gave me) is to use template_preprocess_page() to select that node
template, based on the URL, and then use a custom function to find and
load the node in question. I'm not sure it will work, but before I
try, is there any other (better) way to do this?

Thanks!


More information about the support mailing list