Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Babajide 26 posts 46 karma points
    Aug 13, 2012 @ 18:54
    Babajide
    0

    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)
                              {
                              <href="#"><img src="@item.image" alt="@item.Name"></a>
                              <h4>@item.Name   <span class="fright">&gt;</span></h4>                              
                               }
                              
                            </div>   

              </div>
             <div class="span2"></div>
      </div>

    Thanks.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Aug 13, 2012 @ 22:40
    Jan Skovgaard
    0

    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

  • Babajide 26 posts 46 karma points
    Aug 13, 2012 @ 23:45
    Babajide
    0

    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.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 14, 2012 @ 09:28
    Jeroen Breuer
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft