Jump to:

10851 Posts in 2517 Topics by 1793 members

All other Modules

SilverStripe Forums » All other Modules » Image Gallery images not showing in custom theme

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1383 Views
  • motoservo
    Avatar
    Community Member
    24 Posts

    Image Gallery images not showing in custom theme Link to this post

    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?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery images not showing in custom theme Link to this post

    Can you post your template?

  • DanStephenson
    Avatar
    Community Member
    115 Posts

    Re: Image Gallery images not showing in custom theme Link to this post

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

    My template is attached.

    Attached Files
  • BlueO
    Avatar
    Community Member
    52 Posts

    Re: Image Gallery images not showing in custom theme Link to this post

    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()
       {
             if($this->SingleAlbumView())
                return $this->renderWith(array($this->getModelClass().'_album','Page'));
             return $this->renderWith(array('ImageGalleryPage','Page'));
       }

    renders the initial page with ImageGalleryPage_album.ss

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

    correct me if i'm wrong?

    b

    b

    1383 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.