problem including page_toppath template

Author Message

zaxofeel .v

Wednesday 11 April 2007 8:55:12 am

hi all
I have a strange problem, when I include the page_toppath template within the pagelayout it works fine and the path is displayed perfectly
but I don't want to include the path in the pagelayout, i inluded it in some templates but it is not working, i think the $module_result.path is empty
does anybody know why would it be working with the pagelayout only?

Michael Lee

Wednesday 11 April 2007 9:18:48 am

Hi Zaxofeel,
The $module_result variable can only be used in "pagelayout". In fact, each eZ Publish module will set its module_result variables in an array called $Result and eZ Publish will set $Result as a template variable in "pagelayout"

Michael Lee | Managing Director | ZerusTech Ltd | www.zerustech.com

Skype: zerustech

zaxofeel .v

Wednesday 11 April 2007 9:26:50 am

Thanks lee for the useful info :)
so let's change the question,
how can I modify the
{section loop=$module_result.path} to let it work from an template not only the pagelayout?
i thought about a fetch function but actually i reached nothing.
any suggetions?

Michael Lee

Thursday 12 April 2007 1:57:31 am

I'm afraid that's not quite possible, because eZ Publish works as the follows:
1. user access a URL
2. eZ Publish parses the URL and determines which module and view to execute in "index.php"
3. eZ Publish executes the module/view
4. The view script sets several tpl variables to a tpl, fetches the tpl, set the tpl result as $module_result.content and set module path as well.

$Result = array();
$Result['content'] =& $tpl->fetch( "design:foo.tpl" );
$Result['path'] = array( array( 'text' => TEXT,
                                          'url' => URL ) );

Note: the module path was set after the tpl was fetched. So in the module template, you actually don't have the access to module path.
6. index.php finally fetch the pagelayout and register $Result variable as $module_result in pagelayout.

However, I guess there is a workaround, but I never tried that before.
Maybe you try to include the toppath template in pagelayout but make it invisible and use ajax to copy the 'innerHTML' of the toppath template into other area.

Michael Lee | Managing Director | ZerusTech Ltd | www.zerustech.com

Skype: zerustech

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 19:38:39
Script start
Timing: Jan 18 2025 19:38:39
Module start 'layout'
Timing: Jan 18 2025 19:38:39
Module start 'content'
Timing: Jan 18 2025 19:38:39
Module end 'content'
Timing: Jan 18 2025 19:38:39
Script end

Main resources:

Total runtime0.0207 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 589.1484152.6406
Module start 'layout' 0.00670.0038 741.789139.4766
Module start 'content' 0.01040.0073 781.265693.4609
Module end 'content' 0.01770.0029 874.726634.3047
Script end 0.0206  909.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002913.8890140.0002
Check MTime0.00125.9829140.0001
Mysql Total
Database connection0.00125.874510.0012
Mysqli_queries0.003316.024530.0011
Looping result0.00000.106110.0000
Template Total0.002110.210.0021
Template load0.00115.327610.0011
Template processing0.00104.805010.0010
Override
Cache load0.00083.876310.0008
General
dbfile0.00021.196480.0000
String conversion0.00000.047340.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.0002 secs