Forums / Setup & design / Use of set-block

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