[support] Display Node with Template

Brian Choc bchoc at t4tcolorado.org
Wed Jan 27 23:55:29 UTC 2010


I think I'm following you, but maybe I've missed your point.

Couldn't you just setup a View to display one node of type class, filtered
by your CCK field, sorted by random?  Use "node view" of that one node in
the View, and you'll get one URL that shows whatever random featured node
shows up using the node-class.tpl.php template.

Brian





On Wed, Jan 27, 2010 at 6:06 AM, Fred Jones <fredthejonester at gmail.com>wrote:

> 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!
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>



-- 
Brian Choc
Technology Director

Teaming for Technology Colorado
2505 18th St. Denver, CO 80211
P: 303.561.2377, F: 303.455.6462
http://www.t4tcolorado.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20100127/99a076a6/attachment.html 


More information about the support mailing list