Jump to:

10931 Posts in 2614 Topics by 1810 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: 76389 Views
  • UncleCheese
    Avatar
    4085 Posts

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

    I would LOVE to find a better way to do this. The die() statement was supposed to be a temporary fix, but ended up sticking because nothing else works. I opted not to use a redirect because people who have only one album are going to want the URL /my-gallery/ to show all their photos and not /my-gallery/album/DefaultAlbum. I know that would get a negative reaction. I wouldn't want it, myself.

    Anyone else? I wonder if that code needs to be moved to the index() action instead of init().

  • jhirm
    Avatar
    Community Member
    21 Posts

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

    Moving the die() to the index() function solved the security problem for me without the sloppy URL... good call!

    In the init() I now have:

    if(!isset($this->urlParams['Action'])) {
       //SingleAlbumView, handled in index()
    } elseif($this->CurrentAlbum()) {
       $this->includeUI();
    }

    And in the index() is the die():

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

    EDIT: It doesn't get rid of the unconventional use of die() though...

  • Liam
    Avatar
    Community Member
    470 Posts

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

    So I finally got around to installing this on the latest nestedurls update and ran into an error.

    When I try to add/edit an album I get this error in the lightbox window in the cms admin.

    Fatal error: Call to a member function getErrors() on a non-object in /home/dreamer/public_html/new/sapphire/forms/Form.php on line 543

    I know you don't deal with nestedurls, but any thoughts on this?

    I'm in a jam because it's a very important project to use sub urls, and this photo gallery will be a main page of the site with 100s of albums over the long run. Gah.

  • UncleCheese
    Avatar
    4085 Posts

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

    Yeah, I've never used that module. Do you have any instances of a DataObjectManager running successfully? Because the albums interface is just a straight DataObjectManager -- nothing fancy going on. I have a feeling if that is failing for you, then DataObjectManager is not compatible with NestedURLs, which means perhaps ComplexTableField isn't, either, because they both use the same URL handlers.

    Hmm..

  • Liam
    Avatar
    Community Member
    470 Posts

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

    No, I just installed the whole package and used it out of the box. To be honest, this is the first time working with dataobject_manager and the image gallery. I haven't even taken the time to learn how to use it, I just did a quick upload to test to see if it would work out of the box before spending too much time with it.

    I have a feeling you're right and it's just not compatible. Gah now I really have no idea what to do with this situation...

  • Felicia
    Avatar
    Community Member
    7 Posts

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

    Hi Uncle Cheese,
    The NextAlbum function is not returning the next album. It is actually returning the last album. Has anyone else seen this problem?
    I just re-installed all the newest versions of DataObjectManager, ImageGallery, & SWFUploadField, but no luck.
    I also tried re-sorting the albums and then placing them back to their original positions with no luck. Please help!

    You can see what I am talking about here: http://66.147.242.166/~pascetti/railings-stairs/album/Cable-Railings

    Thank you for your help!

    *** I got it ***

    *I changed the ImageGalleryPage.php file *
    from this

    * * * *
    public function NextAlbum()
       {
          return $this->adjacentAlbum("next");
       }
    * * * *

    to this

    * * * *
    public function NextAlbum()
       {
          return DataObject::get_one(
             "ImageGalleryAlbum",
             "ImageGalleryPageID = {$this->ID} AND SortOrder > {$this->CurrentAlbum()->SortOrder}",
             false,
             "SortOrder ASC"
          );
          
       }
    * * * *

    It is now working. Yay!

  • Yulia
    Avatar
    Community Member
    26 Posts

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

    Hi!

    i have a question...

    I have many albums on one page, they positioned vertically and description goes on right. the page gets too long because of that. How to do, so after certain amount of albums it will create next page, like in forums here... 1.2.3 so on...?

    another question, i would like to be able to display feature album or images on home page, or most recent ones. It could be just an image, or little slideshow?

    Is there anybody who thought of it, because i am kind of stuck... )

    thank you so much!

    great work

    Yulia

  • UncleCheese
    Avatar
    4085 Posts

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

    @LeeUmm - Can you confirm whether ComplexTableFields are working the NestedURLs module?

    @Felicia - I'm aware of this issue. The solution is to just sort the album list once. It happens because the albums are not getting a default sort order on creation.

    @Yulia - I haven't set up pagination on the albums list yet. I should probably add that in. As far as a featured image, gallery, or album, that's something you need to handle in your HomePage object.

    $has_one = array('FeaturedAlbum');

    $fields->addFieldToTab("Root.Content.Main, new DropdownField('FeaturedAlbumID','Featured Album', DataObject::get("ImageGalleryAlbum")->toDropdownMap('ID','AlbumName')));

    and on your template

    <% control Featured Album %>

    Of course, you could substitute ImageGalleryImage or ImageGalleryPage in that code, as well.

    76389 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.