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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Show images in ArticleHolder


Go to End


21 Posts   5094 Views

Avatar
UncleCheese

Forum Moderator, 4102 Posts

16 December 2009 at 4:04am

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

Avatar
frabraha

Community Member, 49 Posts

16 December 2009 at 10:07pm

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

Avatar
UncleCheese

Forum Moderator, 4102 Posts

17 December 2009 at 3:54am

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

Avatar
frabraha

Community Member, 49 Posts

17 December 2009 at 9:24pm

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

Avatar
frabraha

Community Member, 49 Posts

17 December 2009 at 10:01pm

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

Go to Top