Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Grabbing content from descendants


Go to End


2 Posts   1168 Views

Avatar
KatB

Community Member, 105 Posts

28 March 2008 at 7:12pm

Edited: 28/03/2008 7:35pm

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 :)

Avatar
(deleted)

Community Member, 473 Posts

28 March 2008 at 8:04pm

Edited: 28/03/2008 8:08pm

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