Forums / Developer / problem including page_toppath template

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

eZ debug

Timing: Jan 18 2025 16:19:03
Script start
Timing: Jan 18 2025 16:19:03
Module start 'content'
Timing: Jan 18 2025 16:19:03
Module end 'content'
Timing: Jan 18 2025 16:19:04
Script end

Main resources:

Total runtime0.1367 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.9609180.8281
Module start 'content' 0.00620.0049 769.789198.0234
Module end 'content' 0.01110.1256 867.8125526.3281
Script end 0.1366  1,394.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00342.4606200.0002
Check MTime0.00140.9933200.0001
Mysql Total
Database connection0.00110.801110.0011
Mysqli_queries0.095569.88071410.0007
Looping result0.00120.86471390.0000
Template Total0.125191.510.1251
Template load0.00080.608710.0008
Template processing0.124390.896010.1243
Override
Cache load0.00060.415510.0006
Sytem overhead
Fetch class attribute can translate value0.00070.509110.0007
XML
Image XML parsing0.00030.202010.0003
General
dbfile0.00171.2340200.0001
String conversion0.00000.004230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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