Copied to clipboard

Flag this post as spam?

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


  • René Andersen 238 posts 684 karma points
    Jan 30, 2015 @ 16:36
    René Andersen
    0

    Grid on CurrentPage - Children

    Hello,

    I have a main portfolio page that has several portfolio items / thumbnails build up by child pages. When you click on one of the thumbnails you are not directed to the child page but the portfolio item just expand the page and show the content.

    I want to use the Umbraco Grid System but i dont know how to make it work in this solution.

    I have tried:

    @CurrentPage.Children.GetGridHtml("content")


    But the does not work. Does anyone know how to use the grid system on child items without opening the actual child page?

    I hope that my description makes sense. :-)

    // René

  • Dennis Aaen 4433 posts 17887 karma points admin hq c-trib
    Jan 30, 2015 @ 23:57
    Dennis Aaen
    1

    Hi René,

    I am not sure that this is possible to get a grid from a child page and display it. Remember is the first draft of the new Grid layout data type. Perhaps you can use a marco parameter and then choose the id of the page that you want to display when the user clicks to expand the page.

    I can see that on the issue tracker there is an issue about ability to call the grid recursively http://issues.umbraco.org/issue/U4-5987

    So I don´t think that you can´t use the grid layout for every thing. If you see the best practies on how to use this grid, there are some limitations
    read about these limitations here: http://our.umbraco.org/Documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Grid-Layout-Best-Practices#Limitations

    The grid layout documentation is available here http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/built-in-property-editors-v7/Grid-Layout

    And if you see the Fanoe starter kit, the grid layout is used in combination with the traditional way to build Umbraco website, before the grid layout was introduced. (See the blog) They use the multiple textbox for the teaser of the blog post.

    If you haven't seen it yet there is a article from last year's advent calendar about the grid layout editor.http://24days.in/umbraco/2014/grid-macros/

    I know this was not the answer that you were hoping for but, hope this can help you.

    /Dennis

  • René Andersen 238 posts 684 karma points
    Jan 31, 2015 @ 00:30
    René Andersen
    0

    Hi Dennis,

    Thanks for the answer. I will look at the links that you posted and if I find a good solution I will get back to you.

    // René

  • Marc Ferrold 24 posts 105 karma points
    Sep 14, 2015 @ 08:16
    Marc Ferrold
    1

    I've got something like this working actually.

    I go through a few hoops to make it work and to be completely honest, I'm not sure exactly why these actions make it work, but they do.

    If I do this first:

    IPublishedContent currentPage = Umbraco.Content(CurrentPage.Id);
    IEnumerable<IPublishedContent> children = currentPage.Children().Where(x => x.IsVisible());
    

    Then this:

    foreach(var child in children){
        @child.GetGridHtml("grid")
    }
    

    Starts working, for whatever reason. I stumbled upon this by accident - just mindlessly doing it, having forgotten that it shouldn't work, and at some point I figured "Wait... Why did that work now?"

  • Kasper Skov 66 posts 346 karma points
    Sep 14, 2015 @ 17:34
    Kasper Skov
    0

    I get an error from the bootstrap3.cshtml saying 'string' doesn't have a definition for 'sections': enter image description here

    Any idea what that can be?

  • Jan Borup Coyle 6 posts 30 karma points
    Aug 30, 2019 @ 12:52
    Jan Borup Coyle
    0

    Hey Kasper

    Got same problem in a Custom GridEditor i made, so did you solve this problem ?

    Regards Jan Borup Coyle

  • Chris 92 posts 238 karma points
    Jan 11, 2016 @ 11:57
    Chris
    0

    Hey,

    are there any news to the problem Rene encountered?

    Wanted to do exactly the same, render the Grid Datatype of a ChildPage.

    Best regards,

    Chris

Please Sign in or register to post replies

Write your reply to:

Draft