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 %>
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba
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 %>
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..
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 %>
Just to be sure that I have this right.. $ArticleBildeProperty1 is something like $Attachment or $Name, right?
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