Multiple Pagelayouts

Author Message

Don MacLeod

Thursday 02 October 2003 2:57:14 am

I wish to have multiple sections on my site which have different page layouts - banner, links, background color etc. To achieve this I realise that I need a separate pagelayout template per section.

Question is - How do I structure my templates, override/templates directories and override.ini.append to assign a pagelayout for a section? I can see how to assign class templates based on section ...

Match[section]=4

... but my ideal solution would be to have a pagelayout.tpl per section and be able to integrate the class template types such as article, image, product etc within each one by using the override mechanism (not by emebedding the source code for each one in the pagelayout.tpl).

What I'm trying to say is that I don't want to end up with loads of separate pagelayout files with the class already integrated in them like .....

pagelayout_section_1_article.tpl
pagelayout_section_1_infopage.tpl
pagelayout_section_1_image.tpl
pagelayout_section_2_article.tpl
pagelayout_section_2_infopage.tpl
pagelayout_section_2_image.tpl
v
v
v
v
pagelayout_section_x_article.tpl
pagelayout_section_x_infopage.tpl
pagelayout_section_x_image.tpl

Any ideas?

Thanks,

Don.

Don MacLeod

Thursday 02 October 2003 9:07:28 am

OK - I've found a solution to my own question.

I added the following to override.ini.append ...

[pagelayout_corporate]
Source=pagelayout.tpl
MatchFile=pagelayout_corporate.tpl
Subdir=templates
Match[section]=4

... which means that the corporate pagelayout template is invoked for content belonging to that section (4). What this also means is that the [folder], [article], [image] etc templates can be applied to whichever section template is the current one.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.