Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Grabbing content from descendants

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 824 Views
  • KatB
    Avatar
    Community Member
    94 Posts

    Grabbing content from descendants Link to this post

    WidgetHolder has WidgetPages, which in turn have WidgetImagePages.
    So WidgetPages can have multiple images, each stored in WidgetImagePages.

    I would like WidgetHolder to access a small version of the image in the first WidgetImagePage listed for each WidgetPage.

    How do I grab hold of that content?

    Edit: Via templates I'll get there

  • simon_w
    Avatar
    Forum Moderator
    467 Posts

    Re: Grabbing content from descendants Link to this post

    <% control WidgetPages %>
    <% control WidgetImagePages %>
    $Image.SetWidth(50)
    <% end_control %>
    <% end_control %>

    Here assuming that the name of the relationships are WidgetPages and WidgetImagePages and that Image is the name of the entry of the image.

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