I'm sure I've seen it somewhere, either here or in the documentation, but I want to create a Function that displays a random image from a "C1 Media Folder" DataReference that has been passed into the function. So, the user puts the function on
the page, and just selects the Folder from which to Get a Random Image.
I think I figured out how to do it with a C1 Image:
Create RandomImage Function
DataReference<C1 Media Folder> named it MyImageFolder
Selected Fields: KeyPath, CompositePath
Filter: Composite.Data.Types.IMediaFileFolder.DataReferenceFilter -> Choose Input Parameter "MyImageFolder"
Page Size: 1
Then, you just do the template magic.
HOWEVER, there's a twist. I have Create an IData datatype called BannerImage which contains as Fields:
C1 Image File MyImage
The idea behind this is that there are Images, like a coupon for example, which will always point to a certain page and are reused throughout the site. The datatype allows these "BannerImages" to be created including a link and reused.
I'm struggling as to how to Access the BannerImage.MyImage inside the function space so I can filter only the BannerImage Objects that contain an Image that is in the
MyImageFolder Input parameter.
Essentially, I need to access the embedded Image's C1 Image Folder inside
C1 Image which is a field of the BannerImage datatype.
I hope this is clear as to what I'm trying to accomplish.