I have a component with 3 RTE, and they are stored as
{
"jcr:primaryType": "nt:unstructured",
"header": "bg",
"jcr:lastModifiedBy": "admin",
"C_background_reasons-to-buy": "<p>Reasons to buy</p>\r\n",
"jcr:lastModified": "Wed Apr 24 2024 10:15:09 GMT+0200",
"sling:resourceType": "org/components/somecomponent",
"textIsRich": [
"true",
"true"
"true"
],
"B_background_random-proposition": "<p>Random proposition</p>\r\n",
"A_background_collection-concept-story": "<p>Collection Concept Story</p>\r\n"
}
I am trying to read 3 properties (starting with A_, B_ & C_ ) and I use sightly to iterate and have some condition..
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @anupampat ,
As per my knowledge there is no such property/feature available on Sightly.
To achieve your scenario, create a sling model for the component and try to make the sorting be done in the backend.
Hi @anupampat ,
As per my knowledge there is no such property/feature available on Sightly.
To achieve your scenario, create a sling model for the component and try to make the sorting be done in the backend.
I would recommend to use Multifield if your requirement permits. Otherwise, you can create a list and add items as the order you want to the Sling Model as @sravs suggested.
Hi @anupampat
I think if you use sling model instead of calling properties directly to sightly, you can resolve the resource and get the valueMap of the resource. Then you will get all the values in a sorted order by the property names. And then you can return this map. You can give a try with this approach.
Thanks,
Asif Ahmed
@anupampat Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies