Copied to clipboard

Flag this post as spam?

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


  • blackhawk 313 posts 1368 karma points
    Jun 09, 2017 @ 20:47
    blackhawk
    0

    How do we get child content from multi-tree picker rendered?

    I have Umbraco 7.6.3

    I am trying to reference a specific "article wide" section from specific pages, within a partcial view, but have no idea where or what it's alias is so I can reference it.

    Within my particle view I have got this far....

    <div class="container">
    <div class="row">
        @foreach (var childPage in CurrentPage.multiTreePicker) {
     <div class="col-xs-4">
       <div>@childPage.Name<br> 
            @childPage.Url<br> 
            @childPage.UrlName<br>
            GetGridHtml(@childPage.Content, "article wide")
            </div>
     </div>
    }    
    </div>
    

    Please help me understand how to get the content. The following line is my issue....

       GetGridHtml(@childPage.Content, "article wide")
    

    I am trying to learn from this document here But I'm doing something wrong...Please help me find my alias :) The grid system doesn't appear to have an alias input field connected to headline, article wide, etc...

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jun 12, 2017 @ 07:51
    Dave Woestenborghs
    0

    Hi blackhawk,

    Do i make the correct assumption that you want to get one row out of the grid of a selected page ?

    Dave

  • blackhawk 313 posts 1368 karma points
    Jun 12, 2017 @ 14:46
    blackhawk
    0

    Actually..just the content within a grid layout for each multi-tree picker item. I am not concerned about capturing the name, url, urlName, etc...I know how do to that.

    This is close to what I want...

            @Html.GetGridHtml(Model.Content, "content")
    

    ...But it's capturing the existing pages content. I want each "childPage" content. See my foreach loop above.

    Thanks

  • blackhawk 313 posts 1368 karma points
    Jun 12, 2017 @ 16:54
    blackhawk
    100

    I solved my problem by using Jeavon Leopold's project called "Umbraco Core Property Value Converters".

    After installing the package in Umbraco 7.6.3, I was able to replace my razor foreach loop above with the following foreach process...

    <div class="row">    
         @{
            var typedMultiMediaPicker = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>
            ("multiTreePicker");
          }
            @foreach (var item in typedMultiMediaPicker)  {
            <div class="col-xs-4">
            @item.Name<br>
            @item.Url<br>
            @item.UrlName<br>
            @item.GetGridHtml("content")
            </div>
            }
    </div>
    </div>
    

    And it now displays the content of each multiTreePicker item, all through my Partial View. Hopefully this information can help someone out too.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

    Continue discussion

Please Sign in or register to post replies