This is an old revision of the document!
Create an HTML button from the given params
When the tag <#Button> is use without any path (like <#Button.caption> for exemple) then it's the Constructor of a TButton object that will be available via the var named Button.
| Name | Mandatory | Description |
|---|---|---|
| template | Yes | The template that will be used to construct the button. |
| href | No | The href params of the link (<a href=”..”>). This parameter will be store in the variable <#button_href> |
| onclick | No | The onclick params of the link (<a onclick=”..”>). This parameter will be store in the variable <#button_onclick> |
| caption | No | The caption of the button (<a href=”..”>caption</a>). This parameter will be store in the variable <#button_caption> |
| title | No | The Title of the link (<a title=”..”>). This parameter will be store in the variable <#button_title> |
| itemprop | No | The itemprop value of the button (<a itemprop=”..”>). This parameter will be store in the variable <#button_itemprop> |
| extra_params | No | Extra params for the link (<a extra_params>). This parameter will be store in the variable <#button_extra_params> |
| extra_class | No | Extra Class for the link (<a class=“Btn_main_class extra_class”>). This parameter will be store in the variable <#button_extra_class> |
We define the template of MyButton.html like this :
<a class="ak_btn_2 ak_btn_2_9<#if condition="<#button.extra_class checksum=1>"> <#button.extra_class><#endif>"
href="<#button.href>"
<#if condition="<#button.onclick checksum=1>"> onclick="<#button.onclick>"<#endif>
<#if condition="<#button.title checksum=1>"> title="<#button.title xmlencode=1>"<#endif>
<#if condition="<#button.itemprop checksum=1>"> itemprop="<#button.itemprop>"<#endif>
<#if condition="<#button.extra_params checksum=1>"> <#button.extra_params><#endif>>
<span>
<#button.caption xmlencode=1>
</span>
</a>
if we call this function
<#Button Template="MyButton.html"
Href="MyPage.html"
Caption="Go to my Page">
the output will be
<a class="MyButtonClass" Href="MyPage.html"> <span class="l"></span> <span class="m">Go to my Page</span> <span class="r"></span> </a>