This shows you the differences between two versions of the page.
en:public:developer:template_system:tags:parameters:default [2012/11/27 11:57] igor |
en:public:developer:template_system:tags:parameters:default [2013/01/27 17:17] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Default ====== | ====== Default ====== | ||
- | Parameter "default" specifies the default value that will be returning if the called functions return nothing or called variable contains nothing. | + | Parameter "default" specifies the default value that will be returning if the called function (or var) |
+ | return and **empty string** or a **null value**. | ||
+ | |||
+ | **NOTE:** By default the content of the parameter "default" will be parsed (all <#..> tags will be evaluated) | ||
+ | before to apply this filter. You can control this behavior throught the parameter | ||
+ | [[en:public:developer:template_system:tags:parameters:AnalyzeTagParams]] | ||
==== Example ==== | ==== Example ==== | ||
- | Assuming we would to print the menu. If some item of the menu hasn't any title we want to put break line instead. | + | <code> |
+ | |||
+ | <#page_title default="ArKadia"> | ||
- | <#menu_items[5].title default="<br>"> | + | </code> |
- | 1. 5-th item of the menu has title "Special promotions". Output: | + | **Case 1.** Page_title is "Special promotions". Output: |
+ | <code> | ||
Special promotions | Special promotions | ||
+ | </code> | ||
- | 2. 5-th item of the menu hasn't title. Output: | + | **Case 2.** Page_title is empty. Output: |
- | <br> | + | <code> |
+ | ArKadia | ||
+ | </code> |