Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Latest albums on frontpage

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 1398 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: Latest albums on frontpage Link to this post

    return DataObject::get("ImageGalleryAlbum", "ImageGalleryPageID > 0", "Created DESC", $num);

  • sajok
    Avatar
    Community Member
    82 Posts

    Re: Latest albums on frontpage Link to this post

    if I understood you correctly, this is what my function now looks like:

    function LatestAlbums($num=4) {
    return DataObject::get("ImageGalleryAlbum", "ImageGalleryPageID > 0", "Created DESC", $num);
    }

    this still returns an error..

  • sajok
    Avatar
    Community Member
    82 Posts

    Re: Latest albums on frontpage Link to this post

    Thank you so much UncleCheese, this works now after adding an empty parameter before $num.

    function LatestAlbums($num=4) {
    return DataObject::get("ImageGalleryAlbum", "ImageGalleryPageID > 0", "Created DESC", "", $num);
    }

    1398 Views
Page: 1 2
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.