Jump to:

10987 Posts in 2724 Topics by 1817 members

All other Modules

SilverStripe Forums » All other Modules » Image Gallery Extension: Testers Needed

Discuss all other Modules here.

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

Go to End
Author Topic: 77069 Views
  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    I have figured out that this code has "die" in it which I think is keeping my init from running.

          if(!isset($this->urlParams['Action'])) {
             if($this->SingleAlbumView()) {
                die($this->renderWith(array('ImageGalleryPage_album','Page')));
             }
          }

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Sure. Keep your init() function as is, only below your css requirement, add all the blocks you need.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Ahh.. that makes sense. Yeah, something was weird there.. when i just put return $this->renderWith, it came back blank, as I remember. die() was the only thing that worked for some reason. If you figure it out, let me know, and I'll make the update.

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Could you add a public $useTemplate = 'ImageGalleryPage_album"; like you did with public $itemClass?

    That won't help with the die() blocking my entire init() though.

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Here is what I did to make this work.

    I added: public $useTemplate = "ImageGalleryPage_album"; to ImageGalleryPage.php

    and changed the ImageGalleryPage.php init to look like this:

       public function init()
       {

          parent::init();
          self::prototype2jquery();
          Requirements::css('image_gallery/css/ImageGallery.css');
          
          if ($this->useTemplate == "ImageGalleryPage_album"){
             if(!isset($this->urlParams['Action'])) {
                if($this->SingleAlbumView()) {
                   die($this->renderWith(array('$this->useTemplate','Page')));
                }
             }
             else if($this->CurrentAlbum())
                $this->includeUI();
          }

       }

    then I set the public $useTemplate = "ImageGalleryPage_album in my subclass, then it all seems to work.

  • stx333
    Avatar
    Community Member
    14 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Hi Uncle, didn't know where to ask this so I just replyed to one of yours..

    A quick question:

    In the "Configuration" tab there is a "normal size" input. Is there any way NOT to specify the size? What I'm doing is a gallery of images not of the same size - is there a way?

    By the way - putting anything BIG like 5000 causes SS to throw an error without any explenation.

    Thanks a lot for the answer.

    Stx

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Unfortunately, the ImageGallery is built to output uniform sized thumbnails and full-sized images. If you want to break that convention, I'd recommend using the ImageDataObjectManager to build your Image class and template.

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: Image Gallery Extension: Testers Needed Link to this post

    Hey, I had a huge long question posted here that was probably too difficult to understand so I removed the text. The forum software doesn't allow me to just delete one of my posts so I am just putting this explanation instead. If a mod wants to delet this post then please do. Also It would be something that might be good to add to the forum modules that people can delete their own posts if need be.

    Thanks all.

    77069 Views
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.