WebBasic CMS
References

variable

set variable in template

Instruction variable used to create variables. Variables can be used for substitution in the template or to use in various conditions.

Note ! Tag contains the instruction variable , after create the variable will be deleted.

Example :

<meta data-wb-role="variable" var="phone" value="+1 (900) 123-45-67"> 
<p> 
To contact with the office, please call to 
<a href=tel:{{_VAR[phone]}}> 
  <i class="fa fa-phone"></i> 
{{_VAR[phone]}} 
  </a> 
</p>

Example :

<ul class="menu" data-wb-role="tree" data-wb-item="menu"> 
  <meta data-wb-role="variable" var="class" data-wb-if='active = "on"' value="active" else=""> 
<li class="{{_VAR[class]}}"> 
<a href="{{uri}}">{{name}}</a> 
</li> 
</ul> 

Control attributes :

data-wb-role
the name of the user variable
data-wb-if
when not executing which variable is assigned the value recorded in the attribute else
var
the variable name
value
the value of the variable
else
the value of the variable that is assigned if the condition in the attribute data-wb-if fails