This is an old revision of the document!
You can use this tag to construct a TPromotions object (and store it in the variable named <#Promotions>) or to return directly the html content of all promotional boxes for a given space (if you specified some values for the parameter Template and Template_item). The list of promotional boxes is taken from the cfgpages configuration file
When the tag <#Promotions> is use without any path (like <#Promotions.text> for exemple) then it's the Constructor of a TPromotions object that will be available via the var named Promotions.
Name | Mandatory | 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 cfgpages xml file configuration |
VarName | Yes | The name of the variable that will be assigned to the newly created object. If the function is called from the tag <#Promotions> then the name will be Promotions |
Template | No | Parse this template with the new created TPromotions object, return the result and free the object |
The list of promotional boxes will be taken from the cfgpages xml file configuration. ex if the xml file configuration contain :
<page name='/'> <cfg> ... <promotions name="right" maxtoshow="2" random="1" /> <promotion processname="hardfile" filename="promo1.html" random="0" /> <promotion processname="hardfile" filename="promo2.html" /> <promotion processname="hardfile" filename="promo3.html" /> </promotions> <promotions name="left"> <promotion processname="hardfile" filename="leftframe_promo_google_120x240.html"/> </promotions> </cfg> ... </page>
then the <#promotions name=“right”> will add in the <#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 <#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).
<#{promotions name="right"> <#{template> <#if condition="<#promotions.count> > 0"> <#promotions[0].content> <#endif> <#}template> <#}promotions>
this will output
<#frame processname="hardfile" filename="promo1.html">