17488 Posts in 4473 Topics by 1978 members
| Go to End | Next > | |
| Author | Topic: | 5212 Views |
-
Albums in Gallery

22 July 2008 at 10:38am
I seem to be having trouble finding the "easy" way to create albums in Gallery 0.2.2. Is there an easy way or will I have to create a new page type & so forth?
-
Re: Albums in Gallery

22 July 2008 at 1:47pm
The gallery does not support albums as far as Im aware but this would be an awesome feature if you can contribute! I think what most people do - or what ive done in the past is make a GalleryHolder.php which has GalleryPage - Albums and that galleryholder just lists all the albums etc..
-
Re: Albums in Gallery

14 November 2008 at 12:59pm Last edited: 14 November 2008 12:59pm
Hi Willr
how do you create a GalleryHolder and get it to return the images from its galleryPage children?
I can't seem to figure out how to return a group of dataObjectSets to display in the template. I'm no SS pro so I may be approaching this in the wrong way; I'm pretty much using the same method as the LatestArticles function in tutorial 2 and calling CurrentGalleryItems for each of the child pages, but I can't figure out how to make a group or array of these dataObjectSets to return to the template?.....:S
-
Re: Albums in Gallery

15 November 2008 at 3:17am Last edited: 20 November 2008 10:57pm
This would be a great addition to Gallery.
Aram, you seem to have the right idea, but with my simple capabilities I could not help you.
At the moment, I have a gallery HOLDING page, with various images, with each one linked directly to each album. Simple - but not ideal.
Regards,
Dave -
Re: Albums in Gallery

15 November 2008 at 5:00am Last edited: 15 November 2008 5:01am
ahhhh, I think maybe that's what willr meant too, he just lists links the the albums rather than displays any of the photos within them.
I can display the first page of images by hard coding the gallery names into the template doing the following
GalleryHolder.phpfunction getGalleryItems($gallery){
$galleryPage = DataObject::get_one("GalleryPage", "Title = $gallery");
return $galleryPage.CurrentGalleryItems();
}
GalleryHolder.ss<% control getGalleryItems(gallery1) %>
themplate stuff
<% end control %>
<% control getGalleryItems(gallery2) %>themplate stuff
<% end control %>
etc....but thats as far as I've got and it's not great because it won't dynamically add child galleries to the holder and will break if you change the names of the existing galleries.......
does anyone know if it's even possible to make an array of dataObjectSets or to somehow return a group of them that the template can iterate over?
-
Re: Albums in Gallery

15 November 2008 at 1:08pm Last edited: 15 November 2008 1:26pm
Ok, so this is actually really easy!
All you have to do to get the first page of pictures from each child gallery is put the following into GalleryHolder.ss
<% control children %>
<a href="$Link">$Title</a>
<% control CurrentGalleryItems %><!-- Template stuff, copied from GalleryPageContent.ss to display the images -->
<% end_control %>
<a href="$Link">go to gallery >></a>
<% end_control %>Thats it! You get a nice set of pictures from each child galleries first page and its title.
can't believe how complicated I had made this, didn't even need any extra controller code! (EDIT: you need to copy the init function from GalleryPage.php so it gets the lightbox code/css etc)
I guess it shows how much I've still got to learn and also how damn awsome SS is
-
Re: Albums in Gallery

20 November 2008 at 8:28am
How would you get the Gallery to display albums?
I tried following the instructions above by aram, but couldn't get it to work.
Do you have any more info? or could you make the files available? -
Re: Albums in Gallery

20 November 2008 at 10:59pm
Yep I tried without success.
Could you attach the files here Aram?
Dave
| 5212 Views | ||
| Go to Top | Next > |





