Hello!

I already know how to use views to create a page for listing a bunch of nodes. Now, when the user clicks on the link to go to that certain node, how can I change how that node page looks? Meaning the layout, format, etc.

So how would I change how- www.mysite.com/node/123124124 looks?

Thank you.

-David Z.

Comments

Patroclas’s picture

dzwestwindsor’s picture

is there a more solid way to do this? More customizable?

I don't mind messing with the code...

Poieo’s picture

To edit on an individual node bases, you would need custom template files: http://drupal.org/phptemplate

You can also check out Display Suite: http://drupal.org/project/ds

yaworsk’s picture

its very easy to theme override with views, you just have to create an appropriate template and in your view, rescan the new template in the views module so the view uses it. views will provide the default code for the template file too.

Mustardseedmedia did up a great video on this, http://mustardseedmedia.com/podcast/episode23

nvl.sateesh’s picture

Well, one of the ways i would do is to have a template file for that particular node type and then render the output as i want it in a specific layout.

For example, if your node type is "story", then you can make a copy of the node.tpl.php file and rename it as node-story.tpl.php file. Then, you can decide how you want to theme it.

some variables you should know before starting are
1. $page
if $page == 0 then, it means it is in a teaser mode and you can use separate layout for it.
if $page !=0, then, it is in full view and you can have a different layout there.

2. $node
this object will have all of the node fields associated with this node. if you choose, for some reason, not to print content using $content, then, you can print them separately like $node->title, $node->body, $node->uid, $node->status, etc

3. You can call any CCK fields by using the format : $node->field_name[0]['value']. if you have set a different Display rule for the cck field, then, you may want to use $node->field_name[0]['view'].

print the arrays and you can see what you can use.

hope this helps.

Sateesh Nutulapati
Devops Solutions Architect at New Target, Inc.