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 2 3
Go to End
Author Topic: 3126 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: Show images in ArticleHolder Link to this post

    If ArticlePage $has_many 'ArticleBildes' and ArticleBilde $has_one 'ArticlePage', then all you need on your ArticlePage.ss is:

    <% control ArticleBildes.First %>
    $ArticleBildeProperty1. $ArticleBildeProperty2
    <% end_control %>

  • frabraha
    Avatar
    Community Member
    49 Posts

    Re: Show images in ArticleHolder Link to this post

    hm..sorry I think you misunderstand me here, the problem is NOT in the ArticlePage.ss its in ArticleHolder.ss
    As I have said before, I have an ArticleHolder.ss template that shows a list of ArticlePages that should show the first image of each ArticlePage that have image added to them.

    I've added an image showing what I mean: Example

    Hopes this clear things up a bit on what I'm trying to do..

  • UncleCheese
    Avatar
    4085 Posts

    Re: Show images in ArticleHolder Link to this post

    If ArticlePages are children of ArticleHolder, than all you need in ArticleHolder.ss is:

    <% control Children %>
    $Title
    <% control ArticleBildes.First %>
    $ArticleBildeProperty1. $ArticleBildeProperty2
    <% end_control %>
    <% end_control %>

  • frabraha
    Avatar
    Community Member
    49 Posts

    Re: Show images in ArticleHolder Link to this post

    Just to be sure that I have this right.. $ArticleBildeProperty1 is something like $Attachment or $Name, right?

  • frabraha
    Avatar
    Community Member
    49 Posts

    Re: Show images in ArticleHolder Link to this post

    Never mind, got it working with that last code

    Tried it on a different template and that worked, must be something very wrong with Articleholder template..

    Thanks for the help

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