override a page layout in a module section

Author Message

François Xavier Lacroix

Monday 03 October 2005 4:06:08 am

I have made a module named XXX with a template overview like in the tutorial;
my probleme is that i need to override the page layout in this template.
I have put in the first place of override.ini.append in my good site access,

[XXXPagelayout]
Source=pagelayout.tpl
MatchFile=newsletter_layout.tpl
Subdir=templates
Match[url_alias]=XXX/overview

But it does not seem to work.
More over i do not have any node_id in this template.
If somebody deal with that, thx in advance...

Kristof Coomans

Monday 03 October 2005 4:53:04 am

In the view of your module, you will need to make an instance of eZTemplateDesignResource and call it's method setKeys.

For an example, look at kernel/content/view.php.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

François Xavier Lacroix

Wednesday 05 October 2005 8:03:19 am

I m not sure that i have greatly understood ... i have checked ernel/content/view.php;
With

$res =& eZTemplateDesignResource::instance();
$keys =& $res->keys();

I can change key['layout'] and by the way, changing the page_layout of my module ?

François Xavier Lacroix

Wednesday 05 October 2005 8:20:07 am

oups i think i find it here
http://ez.no/community/bugs/extension_with_settings_override_ini_append_breaks_ezp_override_system/template_overriding

1. settings/override.ini - the main overrides (we don't recomend to change these settings).
2. settings/siteaccess/<your_siteaccess>/override.ini.append.php - current siteaccess overrides.
[[[[3. extension/<your_extension>/settings/override.ini.appens.php - extension overrides.]]]]
4. settings/override/override.ini.append.php - global overrides.

Kristof Coomans

Thursday 06 October 2005 7:03:14 am

In the view of your module, you need to define the keys for the Match[] setting of your override group.

In <i>kernel/content/view.php</i>, the keys are class, class_identifier etc., which you can use with Match[] in override.ini.append.

Search kernel/content/view.php for "$res->setKeys", and you will find what you are looking for.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

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 18 2025 16:28:21
Script start
Timing: Jan 18 2025 16:28:21
Module start 'layout'
Timing: Jan 18 2025 16:28:21
Module start 'content'
Timing: Jan 18 2025 16:28:21
Module end 'content'
Timing: Jan 18 2025 16:28:21
Script end

Main resources:

Total runtime0.0143 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.0048 589.1563152.6406
Module start 'layout' 0.00480.0023 741.796939.4766
Module start 'content' 0.00710.0051 781.273493.4609
Module end 'content' 0.01220.0021 874.734438.3047
Script end 0.0143  913.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002416.7374140.0002
Check MTime0.00117.5636140.0001
Mysql Total
Database connection0.00053.664510.0005
Mysqli_queries0.002114.443530.0007
Looping result0.00000.069910.0000
Template Total0.001611.310.0016
Template load0.00096.118110.0009
Template processing0.00075.154910.0007
Override
Cache load0.00064.136910.0006
General
dbfile0.00031.904680.0000
String conversion0.00000.034940.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