Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 936 posts 2571 karma points
    Jun 13, 2014 @ 11:39
    Claushingebjerg
    0

    how to render the grid data type i 7.2 alpha

    Anybody got the snippet for rendering content from the new grid datatype in 7.2?

     

  • Garðar Þorsteinsson 113 posts 534 karma points
    Jun 15, 2014 @ 17:25
    Garðar Þorsteinsson
    1

    Hi Claus,

     

    This here is one way of doing it :

    @CurrentPage.GetGridHtml("grid")

     

     

     

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jun 15, 2014 @ 22:30
    Bjarne Fyrstenborg
    102

    You can use this snippet like Niels presented at Codegarden: http://stream.umbraco.org/video/9918428/umbraco-codegarden-14-keynote

    @if(CurrentPage.Grid.ToString() != "")
    { @CurrentPage.GetGridHtml("grid"); }

    /Bjarne

  • Claushingebjerg 936 posts 2571 karma points
    Jun 15, 2014 @ 22:52
    Claushingebjerg
    0

    Cool thanks :)

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Jun 19, 2014 @ 03:35
    Nik Wahlberg
    0

    This is kind of a related question. What stylesheets should be used to render the data correctly? Trying to render a grid in the starter kit with the 7.2-alpha does not work (columns, etc.). Tried standard dist. of Bootstrap but that doesn't seem to make a difference. 

    Any ideas? 

    Thanks all!

    Nik

  • Delly Mellas Nyman 64 posts 316 karma points
    Sep 19, 2014 @ 04:44
    Delly Mellas Nyman
    0

    Same question as Nik, is there any default stylesheets that I have to use? I'm trying rendering grid using txt starter kit and it's doesn't work for the columns.

    Thanks

  • Asbjørn 82 posts 195 karma points c-trib
    Sep 19, 2014 @ 10:08
    Asbjørn
    0

    I believe the default HTML output for the grid property editor is set up to use Bootstrap. You can, however, override that with your own HTML, although that obviously is more work. As to how to override the HTML output, I'm not quite sure yet...

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Oct 29, 2014 @ 10:14
    Sebastiaan Janssen
    3

    Just FYI:

    If your grid property is aliased bodyText you can do:

    @CurrentPage.GetGridHtml()

    Else you have to give it the property alias that you gave it:

    @CurrentPage.GetGridHtml("myGridPropertyAlias")

    By default it will render Bootstrap3 compatible markup. You can overload it:

    @CurrentPage.GetGridHtml("myGridPropertyAlias", "bootstrap2")

    Will render bootstrap2 compatible markup.

    You can also do custom layouts by dropping another view in Views\Partials\Grid

  • Kristian Ravnevand 94 posts 214 karma points
    Oct 31, 2014 @ 11:14
    Kristian Ravnevand
    0

    Hi all, and thanks for the pointers, but the name seems to be getting a different name (RenderCanvas): https://github.com/umbraco/Umbraco-CMS/commit/bba4db46d2c789d1b875d04f35a423d60442fe46

    I also forgot to copy the partial view folder /view/partials/grid from the Umbraco.zip file into my project, that resultet that the "GetGridHtml" rendered nothing.

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Oct 31, 2014 @ 14:10
    Sebastiaan Janssen
    0

    We renamed it back to GetGridHtml in the beta release, we won't be using RenderCanvas.

  • Sam Winograd 1 post 21 karma points
    Dec 05, 2014 @ 01:28
    Sam Winograd
    0

    Hello all. I am trying to set up a grid on a website I'm helping to work on. I am using umbraco 7.2.0. I think I have set everything up right, but when I publish and look at the website, there's nothing on it besides the header and footer. The data type I'm using has grid layout as the property editor. The document type and template are both set up as a grid correctly, I'm pretty sure. The problem with my page has to do with the code in the grid template I think. I took a snippet of code that I found in this thread here.

    Here's the code:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = "ContentMaster.cshtml";
    }

    CurrentPage.Grid.ToString(

    @if(CurrentPage.Grid.ToString() != "")
    {
    @CurrentPage.GetGridHtml("grid");
    }

    Google, and my co-workers don't have any idea about this, if someone could help me on this one and point me in the right direction, that would be greatly appreciated.

  • sw 3 posts 23 karma points
    Dec 15, 2014 @ 18:17
    sw
    0

    Does it mean we do not have a WebForms version for GetGridHtml?

    Thanks

    Sean

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Dec 15, 2014 @ 18:23
    Dennis Aaen
    0

    Hi Sean and welcome to our.

    No doesn't mean you don't have the opportunity for at use the grid in the WebForm mode, because you could make a partial view macro file, and insert the macro into your template, where you need the grid to show up. You can read more about the partial view macro here. http://our.umbraco.org/documentation/Reference/Templating/Macros/Partial-View-Macros/ or http://our.umbraco.org/documentation/Using-Umbraco/Creating-Basic-Site/Articles-Parent-and-Article-Items

    Hope this helps,

    /Dennis

     

  • sw 3 posts 23 karma points
    Dec 16, 2014 @ 10:50
    sw
    0

    Many thanks, Dennis! I will take a look.

    Sean

  • sw 3 posts 23 karma points
    Dec 16, 2014 @ 11:47
    sw
    0

    Confirmed it is working. Thanks!

    Sean

    @inherits Umbraco.Web.Macros.PartialViewMacroPage

    @{

        CurrentPage.GetGridHtml("pageContentLayout");

    }

Please Sign in or register to post replies

Write your reply to:

Draft