내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Customize the "list" component

Avatar

Level 3

Can we customize the "List" component to add the "cq:lastReplicated" in the orderby dropdown. Tried by adding "cq:lastReplicated" in the dropdown value, but its not sorting.  Can u please help.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

The sorting of the list component is implemented by using Java Collections.sort() together with custom Comparators. To change the sorting order, you could do a similar implementation and could control the sorting orders by using different custom Comparators. API details at [1]. The steps are

* Create a custom Comparator<Page>
* In the list component set setOrderComparator with your custom one.
 

The alternative another option is use advanced search feature of list and have query predictor to return as per your need. 


[1] http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/foundation/List.html

원본 게시물의 솔루션 보기

11 답변 개

Avatar

Level 3
I have tried that too.. activated a particular page and tried sorting. But it's not working but the cq:lastmodified which is present in default LIST component works fine. Any help to sort this problem would be very helpful. Thanks...

Avatar

Level 3
I have tried that too.. activated a particular page and tried sorting. But it's not working but the cq:lastmodified which is present in default LIST component works fine. Any help to sort this problem would be very helpful. Thanks...

Avatar

Employee

I haven't experimented with it, but my guess is you need to make sure that the items in the dropdown do in fact have that property. If you are on a local server and not pushing anything, they either won't have the cq:lastReplicated property, or they would all have the same value for it. 

Avatar

Level 3
        tried that also.. activated the particular page and tried sorting. But it's not working but the cq:lastmodified which is present in default LIST component works. Any help tp sort this problemwould be very helpful.. 

Avatar

Level 3
I tried that also.. activated a particular page and tried sorting. But it's not working but the cq:lastmodified which is present in default LIST component works fine. Any help to sort this problem would be very helpful. Thanks...

Avatar

Level 3
        tried that also.. activated the particular page and tried sorting. But it's not working but the cq:lastmodified which is present in default LIST component works. Any help to sort this problem would be very helpful. Thanks...

Avatar

정확한 답변 작성자:
Level 10

The sorting of the list component is implemented by using Java Collections.sort() together with custom Comparators. To change the sorting order, you could do a similar implementation and could control the sorting orders by using different custom Comparators. API details at [1]. The steps are

* Create a custom Comparator<Page>
* In the list component set setOrderComparator with your custom one.
 

The alternative another option is use advanced search feature of list and have query predictor to return as per your need. 


[1] http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/foundation/List.html

Avatar

Employee

Remember when you activate, you are only pushing content (/content/*) and not code (/apps/*). The dialog box is code and might never get the cq:lastReplicated property. Is there a particular reason you need to use this property? Or are you just testing? If you are, I would suggest a different property.

Avatar

Level 3

My requirement is to sort and display the page title of the pages based on last Published date in component present in another page. So tried by adding the  "cq:lastReplicated" in the orderby dropdown of the "LIST" component. Activated the component and the one of the pages which I want to be in the first of my list. But still its not sorting. Am i missing something??

Avatar

Level 3
I have tried that too.. activated a particular page and tried sorting. But it's not working but the cq:lastmodified which is present in default LIST component works fine. Any help to sort this problem would be very helpful. Thanks...

Avatar

Level 3
I have tried that too.. activated a particular page and tried sorting. But it's not working but the cq:lastmodified which is present in default LIST component works fine. Any help to sort this problem would be very helpful. Thanks...