I have a template that renders a custom modal form that looks like this.
_modal.tpl
{% wire id=id_div action={update target=target_div template=div_template }
action={script
script="$('#modal').modal({onOpen: function (dialog) {
dialog.overlay.fadeIn('slow', function () {
dialog.data.hide();
dialog.container.fadeIn('slow', function () {
dialog.data.slideDown('slow');
});
});
},
dataCss: {
margin: 10
},
containerCss:{
height: 500,
width: 550
},
overlayClose:true
});
"
}
%}
I call it like this
{% include "scripts/_uptime_base.tpl" id_div="info" target_div="modal" div_template="info.tpl" id=id %}
{% include "scripts/_uptime_base.tpl" id_div="contact" target_div="modal" div_template="_contact_form.tpl" %}
What I'd like to do, is pass variables to the script text, such as height and width. For instance,
{% include "scripts/_uptime_base.tpl" id_div="info" target_div="modal" div_template="info.tpl" div_height="500" div_width="550" %}
and change my template to look "something" like this ...
...
containerCss:{
height: div_height,
width: div_width
},
...
Any suggestions or comments on how to do this or should I try to make this a scomp?
Cheers
Jeff