Difference between template and script

webharvest
#1

Hi,

What is difference between template and script, if both are evaluated by the scripting engine? one difference is that script can return value from a variable, template is for text manipulations, anything else that i am missing?

<template>${var}</template>
vs
<script return=“var”/>

which is the preferred way to get value and why?

#2

Hi,
I suggest you can think template tag as printf in Java. Lets say if var=3, in case of template “The value is ${var}” returns “The value is 3”. (it substitutes the value)
Whereas script return only returns value from the script, it returns only 3 from the script in this case.

Hope this helps!