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.

eZ debug

Timing: Jan 31 2025 06:28:10
Script start
Timing: Jan 31 2025 06:28:10
Module start 'layout'
Timing: Jan 31 2025 06:28:10
Module start 'content'
Timing: Jan 31 2025 06:28:10
Module end 'content'
Timing: Jan 31 2025 06:28:10
Script end

Main resources:

Total runtime0.0235 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.3906151.2422
Module start 'layout' 0.00530.0031 739.632836.7109
Module start 'content' 0.00830.0134 776.343894.3438
Module end 'content' 0.02180.0017 870.687533.9922
Script end 0.0235  904.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002611.2057140.0002
Check MTime0.00124.9849140.0001
Mysql Total
Database connection0.00062.612510.0006
Mysqli_queries0.002610.932230.0009
Looping result0.00000.063810.0000
Template Total0.00125.110.0012
Template load0.00093.738910.0009
Template processing0.00031.389810.0003
Override
Cache load0.00062.664210.0006
General
dbfile0.004017.178280.0005
String conversion0.00000.028440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs