7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Image Gallery - Latest Images on HomePage?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | ||
| Author | Topic: | 3319 Views |
-
Re: Image Gallery - Latest Images on HomePage?

22 August 2009 at 3:18am
Wow, looks like "lt" is not a valid operator in SS. I could have sworn it was. I would try something like..
$items = $album->GalleryItems()
return $items->getRange(0,5);A better way to do it is probably to extend the album class as I showed you in a previous post.
-
Re: Image Gallery - Latest Images on HomePage?

24 August 2009 at 3:54pm
Hi there
Thanks for this info
I have extended the Image Gallery Pages into a new Page Type (LatestGalleryAlbum & LatestGalleryPage) and incorporated the Latest Album / Images in the home page.
You can see it in action here http://buffaloclub.smpmedia.co.nz/Cheers
-
Re: Image Gallery - Latest Images on HomePage?

14 September 2009 at 11:04am
Just installed Image Gallery (r271) today and trying to get example for latest images on front page to work.
I've put this in the Page_Controller section of my top-level Page.php:
public function LatestImages()
{
return DataObject::get("ImageGalleryItem", null, "Created DESC", null, 8);
}and this at the top of my local copy of ImageGalleryPage.ss, as I want latest 8 images from all galleries to appear on top-level gallery page:
<ul id="gallery-list" class="gallery-layout loaded">
<% control LatestImages %>
<li style="height:{$Top.ThumbnailSize}px;width:{$Top.ThumbnailSize}px;">
<a id="ViewLink-$ID" rel="$RelAttr" class="$ClassAttr" title="$Caption" href="$ViewLink"><img src="$ThumbnailURL" alt="$Title"/></a>
</li>
<% end_control %>
</ul>now I'm getting 8 placeholders return it seems, but each html list item appears as:
<a id="ViewLink-10" class="" rel="" title="" href=""><img src="" alt="#10"/></a></li>
the fact I'm getting an id value back seems to tell me I'm getting close, but why no other attributes populated?
-
Re: Image Gallery - Latest Images on HomePage?

14 September 2009 at 12:49pm
This is bundled in as of a few revs ago.
Just do:
$RecentImagesGallery(8)
on any page.
-
Re: Image Gallery - Latest Images on HomePage?

8 July 2010 at 11:40pm
I know it might seem like I'm bringing back a post from the dead. I read this and it was very relevant to what I'm doing right now.
currently I have a VansPage_album (child), and a VansHolder page (parent). What I'm trying to do is allow my VansHolder page, to display the first three images in the individual VansPage_album album's. Currently i have three vans to show, and $RecentImagesGallery, seems to only want to display the first van, whilst the other 2 vans controls just have that javascript loading animation.
any help would be appreciated.
and sorry if this has been said before, new to ss and did do a quick search with no results.
Cheers
Jack -
Re: Image Gallery - Latest Images on HomePage?

8 July 2010 at 11:40pm Last edited: 8 July 2010 11:40pm
first post and it was a double post...
| 3319 Views | ||
| Go to Top |



