Use of set-block

Author Message

Adolfo Barragán

Wednesday 30 August 2006 5:20:49 am

I need to put code generated by some of override templates inmediately before the closing </body> tag.

Can I use this schema?

1. pagelayout.tpl

<html>
<head>...</head>
<body>
  ...
  {def $myCode=""}
  <div id="maincontent">{$module_result.content}</div>
  ...
  {$myCode}
</body>
</html>

2. override.tpl

...
<div id="map"></div>
...
{set-block variable=$myCode scope=global}
  ...
  ... some mixing javascript and template code
  ...
{/set-block}

$myCode variable is available on both templates?

Regards
Adolfo Barragán

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

Main resources:

Total runtime0.0233 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.0129 587.8125152.6094
Module start 'layout' 0.01290.0035 740.421939.4141
Module start 'content' 0.01640.0047 779.835985.3203
Module end 'content' 0.02110.0021 865.156330.3047
Script end 0.0233  895.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.004920.9410140.0003
Check MTime0.00125.3015140.0001
Mysql Total
Database connection0.00083.407510.0008
Mysqli_queries0.004820.502030.0016
Looping result0.00000.064510.0000
Template Total0.00177.210.0017
Template load0.00093.974310.0009
Template processing0.00073.154710.0007
Override
Cache load0.00062.738210.0006
General
dbfile0.00031.270980.0000
String conversion0.00000.029740.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