The requirement is as soon as the content author drags and drop the newly created rendering from Sitecore SXA toolbox it should show top 6 article items sorted by published date desc. Also, they should be able to change the datasource of each article item. Now, if they want to select any other article item in place of any of top 6 earlier dragged rendering, they should able to do this. Any suggestions to go about it?
1 Answer
You could use a snippet. Snippets are composites that you can create yourself and combine a bunch of renderings to be reused later. https://doc.sitecore.com/users/sxa/17/sitecore-experience-accelerator/en/add,-reuse,-and-edit-a-snippet.html
Only problem that I see with that approach is that it will not be pre-populated with the top 6 articles. The editor will have to set the datasources on each of them. You can set a default datasource, but that is not dynamic (so it will always stay the same).
So to get exactly what you need, you will have to tweak the ootb functionality a little bit. One option could be to go along with the snippet and try to set the datasource when it is created. The SXA team might be able to help you if this is possible - they are available here and on Sitecore Slack..
Another option could be to extend an existing component (e.g. Promo) to show the list based on a datasource that should have a sortable list of the articles. BUt in this scenario you should also be able to hook into the datasource creation to get the initial list to be the "top 6" articles.