solved Is it possible in Site Builder how do I show the latest images posted OR commented on?

alt=
LesRinchen
@lesrinchen
8 years ago
109 posts
...or do I have to make two separate widgets to accomplish this -- one for latest image uploaded and an activity list for latest comments?
updated by @lesrinchen: 12/22/16 11:55:59AM
michael
@michael
8 years ago
7,714 posts
The way the {jrCore_list} function works is it retrieves information stored in the modules datastore. One limit it has is that it needs you to select which datastore to retrieve the information from.

Images are stored in the Gallery datastore, while comments are stored in the Comments datastore. This makes it difficult to combine them into a single search.

From memory, I can remember setting up a system which listened for new comments being added to a datastore item and updated the _updated key for that item.

That again as an example to illustrate the concept: When a new comment gets added to a gallery image item, that gallery image item has its _updated time updated.

So its possible to do, but suspect it would require a module to behave like that. Easier would be to have 2 lists. "Latest images" and "Latest Comments"

Another option is to look at the "Item List (combined)" Site Builder widget provided by the "Seamless" module, then order by _updated on the Gallery and Comment modules. That would provide a list ordered by updated time, but would show a gallery image when it was a gallery, or a comment list item when it was a comment.
paul
@paul
8 years ago
4,326 posts
Another option would be to list comments but search only for comments on Gallery items. The gallery _item_id would be returned as 'comment_item_id' and that could be used in some custom template code (added to the list widget) to show the image.


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
8 years ago
4,326 posts
Actually, we do have a custom module that we developed for another user that will help. It does what Michael suggested - whenever a comment is made on an item, the item's '_updated' time field is updated to the time the comment was made, so you can then use the list widget to list gallery items ordered by '_updated descending'. That way you'll get new gallery items as well as those recently commented upon.
Shall I install this module for you on your site?


--
Paul Asher - JR Developer and System Import Specialist
alt=
LesRinchen
@lesrinchen
8 years ago
109 posts
paul:
Actually, we do have a custom module that we developed for another user that will help. It does what Michael suggested - whenever a comment is made on an item, the item's '_updated' time field is updated to the time the comment was made, so you can then use the list widget to list gallery items ordered by '_updated descending'. That way you'll get new gallery items as well as those recently commented upon.
Shall I install this module for you on your site?

Yes, Paul, I would at least like to give that custom module a try. I've tried Michael's suggestions and haven't had total success yet in getting what I hope to see.

Thanks.
paul
@paul
8 years ago
4,326 posts
Hi Leslie
I've installed that module for you.
How are you planning on customising your site, with SiteBuilder or by modifying the skin templates?
Let me know and I'll update the widgets or code to show you how the above is implemented.
Thanks
Pa


--
Paul Asher - JR Developer and System Import Specialist
alt=
LesRinchen
@lesrinchen
8 years ago
109 posts
I'm mostly using Site Builder so far because I thought it would be easier. But I'm questioning that now and may start modifying templates soon. There's no conflict if I do some of each, is there -- i.e. modifying the menu and some pages with Site Builder and modifying other page's templates...

Anyway, let's try for the Site Builder widget first! Thank you so much!
paul
@paul
8 years ago
4,326 posts
I've updated the gallery widget on your /home2 page and added a test comment to /cathy-rose/gallery/557/offering-bowl and it pushed this image to the top, so it looks like its working :-)

Yes, you can mixed SiteBuilding and template editing. You'll have to edit templates if you want to change 'common' stuff like headers and footers but otherwise, just remember that if you site build one of the default JR pages like /profile or /audio etc, the SB page will always over-ride the template.
hth
Pa


--
Paul Asher - JR Developer and System Import Specialist
alt=
LesRinchen
@lesrinchen
8 years ago
109 posts
Thank you. Looking good. We're making progress!

Tags