Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How to sort web content iterable items.
Hello Exprests,I am using the liferay 7.1.2 CEI have created web content using the structure and template.Now i have created the web content added multiple items clicking on + sign. Whenever we click on + new item added at bottom of previous one.Is there any way to sort those items. As customer want to see the image first which he added at recently. all recent item will come down to the first image.
Thanks
-Amit
Thanks
-Amit
Hi Amit, If I understand what you are saying, every time a new image is added, someone is updating that web content and adding the image to the list? If that is the case, then I would say you have applied the structured content incorrectly. If you need to allow images to be added (over time), and also sorted in DESC order based on create date, then a better solution would be to add a content item for EACH image and then use an Asset Publisher with the appropriate configuration to show them.
My Structure as below
Content --> WebContent + icon to add webcontent.
Form Content section i drag drop the webcontent on page.
These are my steps. I am not aware of Assets Publisher.
Template:{ "availableLanguageIds": [ "ar_SA" ], "defaultLanguageId": "ar_SA", "fields": [ { "label": { "ar_SA": "galleryName" }, "predefinedValue": { "ar_SA": "" }, "style": { "ar_SA": "" }, "tip": { "ar_SA": "" }, "dataType": "string", "indexType": "keyword", "localizable": true, "name": "galleryName", "readOnly": false, "repeatable": true, "required": false, "showLabel": true, "type": "text", "nestedFields": [ { "label": { "ar_SA": "galleryDescription" }, "predefinedValue": { "ar_SA": "" }, "style": { "ar_SA": "" }, "tip": { "ar_SA": "" }, "dataType": "string", "indexType": "text", "localizable": true, "name": "galleryDescription", "readOnly": false, "repeatable": false, "required": false, "showLabel": true, "type": "textarea" }, { "label": { "ar_SA": "coverImage" }, "predefinedValue": { "ar_SA": "" }, "style": { "ar_SA": "" }, "tip": { "ar_SA": "" }, "dataType": "image", "fieldNamespace": "ddm", "indexType": "text", "localizable": false, "name": "coverImage", "readOnly": false, "repeatable": false, "required": false, "showLabel": true, "type": "ddm-image" }, { "label": { "ar_SA": "Date of Event" }, "predefinedValue": { "ar_SA": "" }, "style": { "ar_SA": "" }, "tip": { "ar_SA": "" }, "dataType": "date", "fieldNamespace": "ddm", "indexType": "", "localizable": true, "name": "DateOfEvent", "readOnly": false, "repeatable": false, "required": false, "showLabel": true, "type": "ddm-date" }, { "label": { "ar_SA": "detailsGalleryPage" }, "predefinedValue": { "ar_SA": "" }, "style": { "ar_SA": "" }, "tip": { "ar_SA": "" }, "dataType": "link-to-page", "fieldNamespace": "ddm", "indexType": "", "localizable": true, "name": "detailsGalleryPage", "readOnly": false, "repeatable": false, "required": false, "showLabel": true, "type": "ddm-link-to-page" } ] } ] }
And I have created the webcontent Using<div class="container"> <div class="row"> <#if galleryName.getSiblings()?has_content> <#list galleryName.getSiblings() as cur_galleryName> <div class="col-lg-4 col-md-6 col-sm-6 col-12 padding15"> <article class="image-listing"> <figure> <div class="figure-img"> <a href="${galleryName.detailsGalleryPage.getFriendlyUrl()}"> <img src="${cur_galleryName.coverImage.getData()}"> </a> </div> </figure> <div class="video-title"> <a href="${galleryName.detailsGalleryPage.getFriendlyUrl()}" class="the-title">${cur_galleryName.getData()}</a> </div> </article> </div> <!--#list--> <!--#if--> </div> </div>
Content --> WebContent + icon to add webcontent.
Form Content section i drag drop the webcontent on page.
These are my steps. I am not aware of Assets Publisher.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™