SmartletBox Example
This example shows how to use the smarltetbox macro in a Smartlet.
Smartsite SXML | Copy Code |
---|---|
<se:pagetranslations id="smartlets"> <se:collection> <se:member name="sml_test"> <se:smartlet> <se:parameters> <se:parameter name="properties"> <se:collection> <se:member name="data" /> </se:collection> </se:parameter> <se:parameter name="xml"> {smartlet.noinstance()} {smartlet.testproperties()} <se:smartletbox caption="{smartlet.namedarg(boxcaption, default='The Box')}"> {smartlet.get(data)} </se:smartletbox> </se:parameter> </se:parameters> </se:smartlet> </se:member> </se:collection> </se:pagetranslations> {translation.smartlets.sml_test(data="Hello there!", boxcaption="Welcome")} |
Example Result | Copy Code |
---|---|
<div class="sml_box smlbox2 smartlets.sml_test_box"> <div class="smlbox2top"> <span></span> <div class="smlboxbtns"></div> <div class="smlboxcapt">Welcome</div> </div> <div class="smlbox2left"> <div class="smlbox2right"> <div class="smlbox2content"> <div id="sml_smartlets.sml_test_1" class="smartlet smartlets.sml_test"> Hello there! </div> </div> </div> </div> <div class="smlbox2foot"> <span></span> <div class="smlboxfootbtns"></div> </div> </div> |