I'm trying to get the list of pages that author select in component setting
and sort the list by the custom date author select in item page property then display that in HTL.
Currently I'm stuck at pulling that list in JS Use-api.
I have tried getting the list
var list = com.adobe.cq.wcm.core.components.models.List;
var pagesToBeListed = list.listItems;
but I get error "listItems not defined.
How can I get a list of child pages, fixed list or tags in use-api so I can sort them the way I want it?
Views
Replies
Total Likes
Hi,
Instead of trying to sort it in frontend, you can try to sort it in sling model and form the list which can be used directly in sightly.
@Ravi_Pampana JavaScript actually get translated to Java through Rhino. It's not front-end but I agree it's better to use Sling Model but I haven't learned that part yet.
Hi,
Why you need this in use api. The implementation is already done, please check below component
You should use java instead for java use api, just a suggestion.
but still you need to write use api then you can check below
https://jimfrenette.com/aem/javascript-use-api/
@arunpatidar List is implemented but I need to change the Order by a different date property. Currently the List is Order by Last Modified Date or Title. I need to change the Order by the date author can select in page properties. I'm have code in Java for years that's why I was trying to use JS Use-api.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies