Hi,
I am able to display a random photo from the galleries on my home page using the <CSGallery:GalleryPostData /> tag.
Now, I'd like to choose a specific gallery where the random image should be pulled from. I have looked at the properties of CSGallery:GalleryPostData but couldn't find any filtering option. Should I use a <QueryOverrides> ? Can someone show me how to do this?
Thank you.
Jacques
The <CSGallery:GalleryPostData UseRandomPost="true" /> will retrieve a random image based on the context of the control -- if the control is within the context of a Gallery or a Gallery+Album, it will load a random photo from that Gallery or Gallery+Album.
To set the context, you can use a <CSGallery:GalleryList /> control. For example, to specify a specific gallery from which to load the random photo, you could use:
<CSGallery:GalleryList runat="server"> <QueryOverrides SectionApplicationKey="[APPLICATION_KEY_OF_PHOTO_GALLERY]" /> <ItemTemplate> <CSGallery:GalleryPostData runat="server" UseRandomPost="true" Property="Subject" /> </ItemTemplate></CSGallery:GalleryList>
This is exactly what I was looking for. Thank you Ben.
maybe you need auto display:
<script type="text/javascript"> //<![CDATA[ function timerFunction() { <%=CSControlUtility.Instance().FindControl(this, "PhotoUpdater").ClientID %>.Reload(); window.setTimeout('timerFunction();', 10000); return false; }
window.setTimeout('timerFunction();', 10000);
//]]> </script>
baotao:maybe you need auto display:
That's helpful too, thanks, baotao.
hi ben - please tell me: where can i find the application key?
-- Commerce for Community Server at last! 4-roads.com Gary
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com