[prev in list] [next in list] [prev in thread] [next in thread] 

List:       drupal-support
Subject:    Re: [support] Display Node with Template
From:       Zhang Xiao <xellzhang () gmail ! com>
Date:       2010-01-28 3:18:38
Message-ID: BC58B61B-8B27-4B8D-95FB-9A084F85B40B () gmail ! com
[Download RAW message or body]

Hi,

If I understand you correctly, you just need to get the node object then use node_view() to output it.

The template file should be called in this way.

x.

On Jan 27, 2010, at 9:06 PM, Fred Jones 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/ ]

-- 
[ Drupal support list | http://lists.drupal.org/ ]
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic