[themes] displaying a 'View' of a specific content type node?

Justin Gruenberg justin.gruenberg at gmail.com
Fri Apr 10 07:09:51 UTC 2009


On Thu, Apr 9, 2009 at 11:32 PM, sebastian <inforazor at gmail.com> wrote:
> If I were to go down the Views' path, how would I do this? If a user clicks
> the title, they get sent to the Node, not to a View; how can I make it so
> that the user sees the View, with the correct NID, instead of the Node's
> default [non-Views] page? Am I forced to hand-code the title/image links to
> something other than the default [links to Node NID]? If so, how would I do
> that?
>
> I'd like to figure that out even if I do end up theming the node tpl
> instead,

If you were to use views to do this you'd need to set up an entirely
new view.  You would need to use arguments from the URL to specify
what node you want to display (probably the node id).  You would have
to build a link to this view in your taxonomy view.  You would then be
able to theme your new view . . . and you'd be exactly where you're at
right now if you just theme the node page.

Unless I'm misunderstanding your question, doing this in views would
just reimplement what drupal already does.

Your best bet is to make a node template.  You can use the existing
node.tpl.php as an example.  Also, if you look at the api docs (
http://api.drupal.org/api/file/modules/node/node.tpl.php/6 ) you can
see all the variables that will be in scope.  I'd also suggest using
the Devel module ( http://drupal.org/project/devel ) which is like
FireBug for drupal and it'll show you what files to create/modify to
theme just about anything in drupal.


More information about the themes mailing list