This shows you the differences between two versions of the page.
en:public:developer:template_system:tags:promotion:tpromotions:create [2013/01/21 16:16] admin [cfgpages configuration] |
en:public:developer:template_system:tags:promotion:tpromotions:create [2013/04/24 12:04] (current) svanderclock [Parameters] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== <#TPromotions.create> ===== | + | ====== <#TPromotions.create> ====== |
You can use this tag to construct a | You can use this tag to construct a | ||
- | [[en:public:developer:template_system:tags:promotion:TPromotions]] object (and store it in the | + | [[en:public:developer:template_system:tags:promotion:TPromotions]] object. |
- | variable named <#Promotions>) or to return directly the html content of all promotional boxes | + | The list of all the promotional boxes will be taken from the [[en:public:developer:template_system:cfgpages]] |
- | 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 [[en:public:developer:template_system:cfgpages]] | + | |
configuration file | configuration file | ||
Line 12: | Line 10: | ||
===== <#Promotions> ===== | ===== <#Promotions> ===== | ||
- | When the tag <#Promotions> is use without any path (like <#Promotions**.text**> for exemple) then it's | + | 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 | the Constructor of a [[en:public:developer:template_system:tags:promotion:TPromotions]] object that will | ||
be available via the var named **Promotions**. | be available via the var named **Promotions**. | ||
Line 18: | Line 16: | ||
==== Parameters ==== | ==== Parameters ==== | ||
- | ^ Name ^ Mandatory ^ Description ^ | + | ^ Name ^ Mandatory ^ Default ^ Description ^ |
- | | <html><span style="color:#008000">Name</span></html> | 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 | | + | | <html><span style="color:#008000">Name</span></html> | 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 | |
- | | <html><span style="color:#008000">VarName</span></html> | 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** | | + | | <html><span style="color:#008000">VarName</span></html> | Yes | Promotions | The name of the variable that will be assigned to the newly created object. | |
- | | <html><span style="color:#008000">Template</span></html> | No | Parse this template with the new created TPromotions object, return the result and free the object | | + | | <html><span style="color:#008000">Template</span></html> | 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 | |
Line 56: | Line 54: | ||
<code> | <code> | ||
- | <#{promotions name="right"> | + | <#{promotions name="right"> |
- | <#{template_container><#promotions_items.text><#}template_container> | + | <#{template> |
- | <#{template_item> | + | <#if condition="<#promotions.count> > 0"> |
- | <div<#if condition='<#promotions_current_item.index> < <#promotions_items.count> - 1'> style="margin-bottom:15px;"<#endif>> | + | <#promotions[0].content> |
- | <#promotions_current_item.text> | + | <#endif> |
- | </div> | + | <#}template> |
- | <#}template_item> | + | <#}promotions> |
- | <#}promotions> | + | |
+ | </code> | ||
+ | this will output | ||
+ | |||
+ | <code> | ||
+ | <#frame processname="hardfile" filename="promo1.html"> | ||
</code> | </code> | ||
+ |