how do we use AEM SIGHTLY to populate drop down values (values will come via js file) for "SELECT" html tag
how do we use AEM SIGHTLY to populate drop down values (values will come via js file) for "SELECT" html tag
how do we use AEM SIGHTLY to populate drop down values (values will come via js file) for "SELECT" html tag
Since a dropdown basically contains a key/value pair, i'm a big fan of utilizing the ACS Commons Generic Lists (http://adobe-consulting-services.github.io/acs-aem-commons/features/generic-lists.html). This provides an easy interface for authors/admins to edit the text/values in the dropdown on the fly (therefore meaning you don't have to be bothered with modifying a JS file down the road for new options or changes), while also providing a JSON feed that works directly with the widgets supplied in AEM.
So for example, you can do
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq:Widget" fieldLabel="Target" name="./target" options="/etc/acs-commons/lists/age-ranges/_jcr_content.list.json" type="select" xtype="selection"/>
Or if you're really set on using Sightly, you can utilize the API to return getItems() and then use something like the following:
<select data-sly-use.options="options.js"> <option data-sly-repeat="${options.items}" value="${options.value}">${options.text}</option> </select>Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.