sightly with ACS-Commons (generic list)

Avatar

Avatar
Validate 1
Level 1
nandhin_a
Level 1

Like

1 like

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
nandhin_a
Level 1

Like

1 like

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
nandhin_a
Level 1

15-10-2015

I am new to AEM. I have used ACS commons generic list for populating the drop down values. I have added the titles for french and english under localisation part of generic list for each item.consider my js(js based approach in sightly) would return itemList (for ex: var itemList = list.getItems();).    
         how can I get the locale based title available in generic list(for ex, how can i get the french title which i have included under localisation part), in place of ${list.title} mentioned in the below HTML code:           
         <select data-sly-use.frm="sample_form.js"   data-sly-list.list="${frm}">
                                <option value="${list.value}">${list.title}

Could anyone help me on this. Thanks in advance 🙂

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
MVP
bsloki
MVP

Likes

182 likes

Total Posts

1,859 posts

Correct reply

545 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 50
Boost 5
View profile

Avatar
Validate 25
MVP
bsloki
MVP

Likes

182 likes

Total Posts

1,859 posts

Correct reply

545 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 50
Boost 5
View profile
bsloki
MVP

15-10-2015

have you implemented I18N for your titles, if so you need to get I18N for the title. refer [1] for the same

[1] https://docs.adobe.com/docs/en/aem/6-0/develop/components/i18n/i18n-dev.html

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 1
nandhin_a
Level 1

Like

1 like

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
nandhin_a
Level 1

Like

1 like

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
nandhin_a
Level 1

15-10-2015

Thanks for your reply. But that returns me the title in English. Please check my code if I have missed any.

sample.js

"use strict";

use(function () {
    var resolver = sling.getRequest().getResource().getResourceResolver();
var pageManager = resolver.adaptTo(Packages.com.day.cq.wcm.api.PageManager);
var listPage = pageManager.getPage("/etc/acs-commons/lists/sampleoption");
var list = listPage.adaptTo(Packages.com.adobe.acs.commons.genericlists.GenericList);
    var sampList= list.getItems();

return sampList;
});

In my sampForm.html , I have this piece of code:

 <select data-sly-use.reg="sample.js"   data-sly-list.list="${reg}">
                        <option value="${list.title}">${list.title}</option>
 </select>

This prints me the English title only. How can I get the French title (which I have highlighted in the attached screenshot of the ACS-Commons Generic list items)

Avatar

Avatar
Validate 25
MVP
bsloki
MVP

Likes

182 likes

Total Posts

1,859 posts

Correct reply

545 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 50
Boost 5
View profile

Avatar
Validate 25
MVP
bsloki
MVP

Likes

182 likes

Total Posts

1,859 posts

Correct reply

545 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 50
Boost 5
View profile
bsloki
MVP

15-10-2015

list.title should get the title of your language