accessing and setting variable in different blocks
Notice: This thread is very old.
- ivopisarovic
- Member | 5
Hello,
is it possible to set a latte variable and access its value in another block?
Thanks you for advices.
{var $lastId=-1}
{block content}
...
{foreach $items as $item}
...
{var $lastId=$item->id_messages}
{/foreach}
...
{/block}
{block scripts}
{include parent}
<script type="text/javascript">
var messages=new Messages({$lastId});
messages.startRefreshing();
</script>
{/block}