Copied to clipboard

Flag this post as spam?

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


  • Phil 54 posts 139 karma points
    Dec 09, 2014 @ 18:12
    Phil
    0

    7.2.0 - Grid layout with recursive columns?

    Hi all,

    I'm just playing around with the new grid layout in 7.2.0 - is there any way to make certain columns recursive?

    Ie. if I have a parent page with a grid layout named "2 Column Layout", with 2 child pages, each with the same grid layout, is it possible for the content of column 2 on the parent page to show on column 2 of the child pages?

    With Rich Text Editors, I would simply use @Umbraco.Field("column2Alias", recursive:true) on the parent and child templates - is something similar available for the grid layout?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 09, 2014 @ 20:16
    Dennis Aaen
    0

    Hi Phil,

    I don't think this is possible at the moment, the grid layout funtionality for the Umbraco 7.2 was made by the guys from LECOATI. And the guys had a sesseion on this year Codegarden. You can see the session here http://stream.umbraco.org/video/9948281/the-sky-is-the-limit and they are talking about the difference package they have made, including the Grid layout.

    If you donĀ“t what to see the full session, the question if you can reuse the grid layout template, starts in 45:00 minute. When this said you could add a feature request, on this so it would be able to call a grid recrusive. You can create the feature requrest on the Umbraco issue tracker http://issues.umbraco.org

    If you create a feature request please link to the case on the issue tracker so other people that come across this post, can vote for it.

    Hope this is answers your question, maybe I can be wrong here because is a relatively new feature.

    /Dennis

  • Phil 54 posts 139 karma points
    Dec 10, 2014 @ 12:10
    Phil
    0

    Dennis,

    Thanks for that - I have been able to alter the site structure so that this hasn't been such an issue, but I have created a feature request regardless: http://issues.umbraco.org/issue/U4-5987

  • Shannon 6 posts 26 karma points
    Apr 13, 2015 @ 10:12
    Shannon
    0

    There workaround for this:

    @inherits UmbracoTemplatePage
    @{
        Layout = "master.cshtml";
        var home = @CurrentPage.Site();
    }
    ...
    @home.GetGridHtml("footer", "bootstrap3")
    

    Not perfect, but it work!

  • James Cutts 1 post 22 karma points
    May 24, 2016 @ 09:18
    James Cutts
    1

    If you need to recurse a grid you can pass the property directly into the Helper rather than its alias which allows you to recurse it.

    @Html.GetGridHtml(Model.Content.GetProperty("recursiveProperty", recurse: true), "bootstrap3")
    
  • Matthew Kirschner 323 posts 611 karma points
    Feb 28, 2017 @ 15:28
    Matthew Kirschner
    0

    This doesn't always work since the recursive call will view an empty grid as having a value and won't fallback to the parent. You'd have to remove the grid property from any children that want to use their ancestor's grid.

Please Sign in or register to post replies

Write your reply to:

Draft