Right so this may be straight forward but
Is it possible to use a theme with multiple page layout styles?

Cheers
Andy

Comments

nevets’s picture

But the details of what you want to do will determine the how to do and how easy (or hard).

andyau’s picture

It's so you can one layout for the product pages and another layout for the say news or straight text pages.

zeta ζ’s picture

I think what you want is one theme and a standard layout for most sorts of page. Then a new node-type for the product pages. You would then create a node-product.tpl.php for the layout of these pages. There are ways to show/hide other blocks on these pages too.

HTH

nevets’s picture

There is over all page layout which by default is controlled by page.tpl.php which can have variations applied.

There is the layout of the content area and focusing on your need this is controlled by node.tpl.php or a variation of it (you can easily make a type specific version as pointed out above).

And as mentioned above, you can control the visiblity of the blocks

CandiceJarrett’s picture

Thanks for posting this question and for posting answers to it! I had the same question. :-)

andyau’s picture

So is it then possible to select which template you would like to use when creating a new content page?

zeta ζ’s picture

If you mean choosing node-product.tpl.php or node.tpl.php (default) then you choose by creating a node with the appropriate content type.

If you mean choosing the whole style of the page (not just the layout), then http://drupal.org/project/taxonomy_theme could be the answer, just add the appropriate term from a vocabulary and it will be themed accordingly (you will need more than one theme).

nevets’s picture

Regarding theming the whole page, there are alternatives to using the taxonomy theme module since you can have multiple page.tpl.php files (with different names of course). Details depend on what determines which template is to be used.

zeta ζ’s picture

I was referring to the whole style, rather than the whole page.

If you want your choice to be based on content type you can use this to determine the node[-*].tpl.php and page[-*].tpl.php files, as nevets says. These control the layout of the page. See http://drupal.org/phptemplate .

If you want to make your choice based on independent criteria, then http://drupal.org/project/taxonomy_theme can do this, but it selects a completely separate theme (.css etc.) ie. style as well, not just the layout (*.tpl.php), to which the first technique is limited.

bwill’s picture

I solved this problem simply by giving a different name to the .tpl file, as so:

page.tpl.php - main page
page-contact.tpl.php - contact page
page-portfolio.tpl.php - portofolio page
page-about.tpl.php - About page

Each has it's own layout, but uses the same CSS file. Your page alias's would be contact, portfolio. This means you need friendly URL's. Or you could always do something like page-node-4.tpl.php Drupal version for the site I use this for was 4.3. I'm not an expert on how it works, but it's a function of the template engine.