Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Show images in ArticleHolder

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 563 Views
  • frabraha
    Community Member
    49 Posts

    Show images in ArticleHolder Link to this post

    I have a small little problem.

    I have made an ArticlePage that uses the imagedataobjectmanager for images. What I'm trying to do is to show the first image in the ArticleHolder, in the Children list of articles.

    I've been trying different things but can't get the image to show up. First thing I tried was something like this:

    function GetFirstImage($num=1){
    $manager = DataObject::get_one("ArticlePage");
    return ($manager) ? DataObject::get("ArticleBilde", "ArticlePageID = $this->ID", "SortOrder", "", $num) : false;

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.