Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Image Gallery images not showing in custom theme

Go to End

4 Posts   1990 Views


Community Member, 27 Posts

17 April 2010 at 3:37pm

I've installed DOM, SWf Upload, and Image Gallery modules. I can get an Image Gallery page to show my images when using Black Candy but I can't seem to get the images to show up on my custom theme. Other Content from the CMS shows up as expected via the $Content var.

Can anyone shine some light on this for me?


Forum Moderator, 4102 Posts

17 April 2010 at 4:31pm

Can you post your template?


Community Member, 116 Posts

21 April 2010 at 3:17pm

Edited: 21/04/2010 3:17pm

I am having the same issue. Using the variable $GalleryLayout to display my gallery outputs nothing.

My template is attached.

Attached Files

Community Member, 52 Posts

27 May 2010 at 3:53pm

This might be a bit late but I think your problems are caused by the fact that the page is rendered with a different template depending upon how many albums you have. Because:
this function in ImageGalleryPage.php

	public function SingleAlbumView()
		if($this->Albums()->Count() == 1) {
			$this->current_album = $this->Albums()->First();
			return true;
		return false;

Detects if you only have one album and then the following function in the controller:

public function index()
				return $this->renderWith(array($this->getModelClass().'_album','Page'));
			return $this->renderWith(array('ImageGalleryPage','Page'));

renders the initial page with

so if you are putting $content or $GalleryLayout in and you only have one album you won't see anything as it is rendered by the template. This looks like it is the case in the template that DanStephenson posted.

correct me if i'm wrong?