Module Pagelayout

Author Message

Håkan Bergman

Tuesday 18 May 2010 5:05:45 am

Hello,

I have made an extension that calls a template file and it works correctly. I am using colorbox to call my extension like this: /extension/node_id. The colorbox works fine and the template is loading, but I just want the template to load, not the pagelayout itself.

I tried to search for it and also looked at kernel/content/view.php but didn't really see how I could affect the pagelayout. First I tried an override in /siteaccess/page_site in override.ini.append.php with this:

[extension_name]

Source=pagelayout.tpl

MatchFile=extension_name_pagelayout.tpl

Subdir=templates

That code killed the main pagelayout, so I thought I could move it to /extensions/extension_name/settings/override.ini.append.php. But I got the same default behaviour, ie an empty pagelayout on default main site. I need a hint to where I can find more information about how to manipulate pagelayouts inside the PHP-code.

Gaetano Giunta

Tuesday 18 May 2010 5:17:10 am

The override you set up is used globally, as there is no 'criteria' that tells eZ when it has to be applied.

If you want to change the pagelayout used in an ezp module/view, you can use the override conditions defined here: http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_override_conditions

If it's a custom view, you can define the pagelayout used in $Results, eg:

$Result['pagelayout'] = 'xml_pagelayout.tpl';

Principal Consultant International Business
Member of the Community Project Board

Håkan Bergman

Tuesday 18 May 2010 9:23:13 am

Hi Gaetano,

Thanks for your information.

As I want a custom pagelayout (stripped to my needs for a custom JS-box) then $Result['pagelayout'] = 'template.tpl' did the trick. Thanks a lot. I didn't find any information about $Result[] and when I looked in other files all I found was $Result['content'] to load the template I needed.

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 30 2025 19:52:34
Script start
Timing: Jan 30 2025 19:52:34
Module start 'layout'
Timing: Jan 30 2025 19:52:34
Module start 'content'
Timing: Jan 30 2025 19:52:34
Module end 'content'
Timing: Jan 30 2025 19:52:34
Script end

Main resources:

Total runtime0.0489 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0095 588.0156151.1953
Module start 'layout' 0.00950.0045 739.2109220.6719
Module start 'content' 0.01390.0334 959.8828997.6797
Module end 'content' 0.04740.0015 1,957.562533.9922
Script end 0.0489  1,991.5547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00285.7315140.0002
Check MTime0.00112.2032140.0001
Mysql Total
Database connection0.00163.225210.0016
Mysqli_queries0.005611.399730.0019
Looping result0.00000.024410.0000
Template Total0.00112.210.0011
Template load0.00091.794910.0009
Template processing0.00020.439610.0002
Override
Cache load0.00061.249010.0006
General
dbfile0.019038.755380.0024
String conversion0.00000.014140.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