Need help on applying different page layouts to specific content-types

anhk - November 7, 2009 - 21:13

Here's my problem:

I created a view with Views 2 and a content-type that is used as a node filter for my view.

Everything runs smoothly and my nodes are displayed correctly on my view.

Now what I want to do is to set a different page layout (not the view layout but the whole site layout) for that view.

In other words I want to understand how to make Drupal use a particular layout -ie margins, colors, etc.- when a specific content-type is displayed.

I tried to override the page.tpl.php file unsucessfully. The hook trick on the template.php file doesn't seem to work either.

I'm new to Drupal, so I'm sure i'm missing something.

Thanks in advance for your precious help ;-)

If your view has a path (I

nevets - November 7, 2009 - 21:27

If your view has a path (I would assume it does), lets say 'content1' then you can use page-content1.tpl.php to template the page for that path.

problem solved, thank you!

anhk - November 9, 2009 - 08:50

Your solution works wonders Nevets!
Thank you!

 
 

Drupal is a registered trademark of Dries Buytaert.