Carousel of related images

Posted by pcs on 14-Feb-2017 19:00

I have a collection of images held in a related object (rather than as fields on the parent object).

Is there a way to use the native carousel to display these images on the parent record?

I can use related fields (which work with the carousel) but only if the image is linked via a lookup (rather than a collection). I have toyed with the idea of building a formula with a loop, but I doubt the native carousel will recognise these as images.

Any code snippets would be useful...

Posted by Thierry Ciot on 16-Feb-2017 15:56

Ok, here is the way to solve this: you can instantiate the Rollbase carousel object with your own data source containing an array of URLs for the images to render on carousel. This gives you complete control of what to render—and how to render.

I verified the steps and documented the code in this post: https://goo.gl/sM0xaU

Feel free to comment in the post.

Thanks, Thierry.

All Replies

Posted by Thierry Ciot on 14-Feb-2017 21:55

No, this is not possible today as the carousel looks for image fields in the current object (carousel will work if you have more than 1 image field per object but it does not look into related objects).

And no, the carousel won't recognize formula field as images as you correctly guessed !

Could you elaborate on the use case so that we can see if there would be a more general solution for the future?

thanks. Thierry.

Posted by Thierry Ciot on 14-Feb-2017 21:59

By the way, the carousel also works with shared image fields.

Not sure if it would help your case but thought I would mention it.

Posted by pcs on 14-Feb-2017 22:15

Hi Thierry,

Thanks for this. In addition to shared image fields, you can also use a related image (field) which will also render in the carousel (along with the other images).

The use case is like the CMS world where clients manage their own images (like documents) and share them between related objects (1:M or M:M). These images may have other attributes (name, caption, workflow...) and are not shared images (that are stored and distributed with published applications).

The concept of adding a limited number of image fields (rendered in a carousel) doesn't work as well as a [Gallery] type concept where images are selected from an image library.

Your thoughts?

Regards,

Peter

Posted by Thierry Ciot on 15-Feb-2017 11:37

Peter,

Do you have access to eap.rollbase.com?

Posted by Thierry Ciot on 15-Feb-2017 13:34

OK.  I see what you are looking for.  I'll get back to you with an answer.

Posted by Thierry Ciot on 16-Feb-2017 15:56

Ok, here is the way to solve this: you can instantiate the Rollbase carousel object with your own data source containing an array of URLs for the images to render on carousel. This gives you complete control of what to render—and how to render.

I verified the steps and documented the code in this post: https://goo.gl/sM0xaU

Feel free to comment in the post.

Thanks, Thierry.

Posted by pcs on 16-Feb-2017 19:23

Thanks Thierry! The documentation looks great. I will give it a test and see how I go.

Cheers, Peter

Posted by Thierry Ciot on 20-Feb-2017 13:38

I just published a sample app illustrating how to use the Rollbase image carousel with a custom data source on the eap marketplace and you can read all details at: https://goo.gl/sM0xaU

Enjoy. Thierry.

This thread is closed