====== <#TPromotions.create> ======
You can use this tag to construct a
[[en:public:developer:template_system:tags:promotion:TPromotions]] object.
The list of all the promotional boxes will be taken from the [[en:public:developer:template_system:cfgpages]]
configuration file
{{:en:public:promotionalboxes.jpg?600|}}
===== <#Promotions> =====
When the tag <#Promotions> is use without any path (like <#Promotions**.count**> for exemple) then it's
the Constructor of a [[en:public:developer:template_system:tags:promotion:TPromotions]] object that will
be available via the var named **Promotions**.
==== Parameters ====
^ Name ^ Mandatory ^ Default ^ Description ^
| Name | Yes | | the name of the space (right, left, etc.). It's must be the same as the name of the space configured in the [[en:public:developer:template_system:cfgpages]] xml file configuration |
| VarName | Yes | Promotions | The name of the variable that will be assigned to the newly created object. |
| Template | No | | If not empty then Parse this template with the new created [[en:public:developer:template_system:tags:promotion:TPromotions]] object, return the result and free the object |
==== cfgpages configuration ====
The list of promotional boxes will be taken from the [[en:public:developer:template_system:cfgpages]] xml
file configuration. ex if the xml file configuration contain :
...
...
then the <#promotions name="right"> will add in the <#[[en:public:developer:template_system:tags:promotion:TPromotions]]>
object 3 items (promo1.html, promo2.html and promo3.html). But As maxtoshow="2"
then only 2 items only will be added and as random="1" then the
<#[[en:public:developer:template_system:tags:promotion:TPromotions]]> object
will contain only 2 items, promo1.html (because random="0" for this promotion, so
it's prioritary) and one another taken randomly from (promo2.html, promo3.html).
==== Example ====
<#{promotions name="right">
<#{template>
<#if condition="<#promotions.count> > 0">
<#promotions[0].content>
<#endif>
<#}template>
<#}promotions>
this will output
<#frame processname="hardfile" filename="promo1.html">