Creating Groups Areas / Multiple Section Template Overrides?

Author Message

Paul Wilson

Thursday 01 March 2007 4:38:24 am

I'm trying to set up group areas using EZP 3.9.0.

I had:
- groups set up as folders (all in a user groups section)
- user groups having a roles/permissions over a sub-tree of the user groups section.

But this will not work the way I want it because there is no template override method for subtrees. (Yes, there is match[url_alias], but this seems to depend on having a static url - so groups couldn't change names - not without some nifty programming anyway).

So having undone all of that work and redone it so that each group has its own section, I've run into another problem. Perhaps it's obvious and I'm missing something.

I've tried to create an override for pagelayout.tpl.

(In 3.9.0 I've added an override.ini.append.php to /extensions/ezwebin/settings)

Anyway, the override works only for one section/group not the three I specify.

My override entry is:

[pagelayout_groups]
Source=pagelayout.tpl
MatchFile=pagelayout_groups.tpl
Subdir=templates
Match[section]=36
Match[section]=37
Match[section]=38

... the Match[section]=38 is recognised and loaded, the others are not. I even tried separating this out into three entries, each with a single Match[section]. By changing the order I discovered that it is always the last entry that is recognised - the first two are ignored.

I can create three different pagelayout files - one for each section. But then this just adds yet another level of hassle and extra work if I have a large number of groups set up.

I've spent around 2 days now dealing with this aspect of a groups system - for what seems like no result.

Is there something wrong with my override above? or something I'm missing?

Any thoughts gratefully accepted.

Claudia Kosny

Thursday 01 March 2007 5:02:07 am

Hi Paul

You say:

... I even tried separating this out into three entries, each with a single Match[section]. By changing the order I discovered that it is always the last entry that is recognised - the first two are ignored.

This approach should work. From your error description I guess that you have really copied the section three times and just changed the section ids. But you also need to change the name of this override match (the [pagelayout_groups]). Otherwise the last entry will overwrite any preceding entries with the same name.

Claudia

Paul Wilson

Thursday 01 March 2007 2:55:15 pm

Aha. Thanks Claudia, that's it.

Too many long days and late nights/early mornings working with EZ Publish has taken its toll on me.

For anyone else, the method that works is as follows:

Different pagelayouts for each section:

[pagelayout_group_36]
Source=pagelayout.tpl
MatchFile=pagelayout_group_36.tpl
Subdir=templates
Match[section]=36

[pagelayout_group_37]
Source=pagelayout.tpl
MatchFile=pagelayout_group_37.tpl
Subdir=templates
Match[section]=37

OR
The same (new) pagelayout file for each section:

[pagelayout_group_36]
Source=pagelayout.tpl
MatchFile=pagelayout_groups.tpl
Subdir=templates
Match[section]=36

[pagelayout_group_37]
Source=pagelayout.tpl
MatchFile=pagelayout_groups.tpl
Subdir=templates
Match[section]=37

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