I am trying to pull images from my textpage to show on my Industry page, but it is only displaying one of them (refer to the first image). In the second image the red highlight is an "Industry" document type., the blue is a "umbTexpage" doc type and the yellow is a "Images" doc type. Heres the code i use in my Macro:
Before I try providing an answer that features code I'm a bit curious about why you have structured your content the way you have. Why are you having image nodes in the content section instead of having them in the media section and referencing the using a media picker for instance? Is it on purpose to fullfill some UI goal of the backoffice or what is the idea behind it? (I'm just asking to make sure you're doing the best possible structure to ease the work for yourself and the potential editors) :-)
Even though this is what the client wants it might be better to show the client that there are better ways of doing this. With the media library it can be much easier to create what you are trying to do. If you use DAMP you can browse the media library in a friendly way and select multiple images.
How do i pull images from sub nodes
I am trying to pull images from my textpage to show on my Industry page, but it is only displaying one of them (refer to the first image). In the second image the red highlight is an "Industry" document type., the blue is a "umbTexpage" doc type and the yellow is a "Images" doc type. Heres the code i use in my Macro:
<div class="row">
<div class="span10 mleft0px">
<div class="span3">
@foreach (var item in @Model.umbTextpage[0].Images)
{
<a href="#"><img src="@item.image" alt="@item.Name"></a>
<h4>@item.Name <span class="fright">></span></h4>
}
</div>
</div>
<div class="span2"></div>
</div>
Thanks.
Hi Babajide
Before I try providing an answer that features code I'm a bit curious about why you have structured your content the way you have. Why are you having image nodes in the content section instead of having them in the media section and referencing the using a media picker for instance? Is it on purpose to fullfill some UI goal of the backoffice or what is the idea behind it? (I'm just asking to make sure you're doing the best possible structure to ease the work for yourself and the potential editors) :-)
Looking forward to hear from you.
/Jan
Thanks for the reply Jan. Yeah it's a UI thing the client wants. We did a media picker property but they wanted it like this instead.
Even though this is what the client wants it might be better to show the client that there are better ways of doing this. With the media library it can be much easier to create what you are trying to do. If you use DAMP you can browse the media library in a friendly way and select multiple images.
Jeroen
is working on a reply...