Use of Components without editorial contribution

19 views
Skip to first unread message

Giuseppe B

unread,
Jul 9, 2020, 12:41:58 PM7/9/20
to AEM Core Components Developer Community
Hi all,
I was wondering if it possible to use accomplish the following use case with core components.

  1. Let's say we have a component Article which allow the editors to drag&drop components inside the provided container 
  2. After the container we'd like to show related/suggested articles 
    1. articles to show are in same parent folder of the current article

Is it possible to implement a sling model which will make use of the List component by setting/providing the following configurations?:
  • listFrom = children
  • parentPage = currentPage.getParent()
  • childDepth = 1
  • orderBy = modified
  • maxItems = 4


Best Regards,
Giuseppe

kyle giovannetti

unread,
Jul 9, 2020, 1:17:02 PM7/9/20
to aem-core-co...@googlegroups.com
Yes, this absolutely can be done. 

You will need to write a custom list model.
Wrap the resource in a ResourceWrapper to set the properties you want and set the resource type to the current resources parent type.

Use the ModelFactory to build the list model using the wrapped resource.

Kyle

--
You received this message because you are subscribed to the Google Groups "AEM Core Components Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aem-core-componen...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aem-core-components-dev/4fcc2339-cbc3-4bf0-9ae0-46e806418497o%40googlegroups.com.

Rajeev Yadav

unread,
Jul 9, 2020, 1:42:41 PM7/9/20
to aem-core-co...@googlegroups.com
Please refer image-list component in wknd git repo for reference.

Thanks,
Rajeev
Sent from my iPhone

On Jul 9, 2020, at 1:17 PM, kyle giovannetti <kyl...@gmail.com> wrote:



Giuseppe B

unread,
Jul 10, 2020, 4:30:27 AM7/10/20
to AEM Core Components Developer Community
Hi guys,
thanks for the helping suggestions, I was able to accomplish the goal. 
To unsubscribe from this group and stop receiving emails from it, send an email to aem-core-components-dev+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "AEM Core Components Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aem-core-components-dev+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages