Toggle between a bunch of templates in a component
Hi, I have few templates defined in my component , the name's are the values of a dropdown select in the component. I want to check and see if there is a way for me to load one particular template based on the dropwdown select
Here is a sample code which refers to what I am talking about
//Component
<template data-sly-template.left="${@ param}">
<p>${param}</p>
//Some code here
</template>
<template data-sly-template.left="${@ param}">
<h2>${param}</h2>
//Some code here
</template>
<div data-sly-call="${<dropdown-option-name> @param=properties}"></div>
Dropdown options
<headingStyle
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/select"
fieldLabel="Select Heading Style"
name="./style">
<items jcr:primaryType="nt:unstructured">
<left
jcr:primaryType="nt:unstructured"
text="Left"
value="left"/>
<right
jcr:primaryType="nt:unstructured"
text="Right"
value="right"/>
</items>
</headingStyle>
Thanks,
Ravi