javascript - Smarty - pass variable -
javascript - Smarty - pass variable -
i've asked question on how pass variable in smarty: smarty - include template , update existing variable
it's working fine me, need little more advanced see.
in 1 template attach gallery slider template variable:
{$gallery_slider}
in gallery template (which general file other pages, don't want alter it) there's jquery slider options. alter number of visible slides. looks this:
visible : {$partial.visible|default:5},
if alter default 3 in template, works, level of template calls gallery - above {$gallery_slider}.
how do that? i've tried:
{assign var="partial.visible" value="3"}
and
{assign var="partial.visible|default:3"}
and other combinations, none of them works.
i'd appreciate suggestions.
i don't know how used variable (probably fetch
method) should rather utilize include
in case:
{include file="gallery.tpl" items=5} {include file="gallery.tpl" items=3}
and if in gallery.tpl
have:
here can display {$items} in gallery<br />
output be:
here can display 5 in gallery here can display 3 in gallery
so can utilize variable , in loop (or other command structure) utilize variable without problem
javascript jquery html smarty
Comments
Post a Comment