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.
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.
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...
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.
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.
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.
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?
Hi Claus,
This here is one way of doing it :
@CurrentPage.GetGridHtml("grid")
You can use this snippet like Niels presented at Codegarden: http://stream.umbraco.org/video/9918428/umbraco-codegarden-14-keynote
/Bjarne
Cool thanks :)
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
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
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...
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
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.
We renamed it back to GetGridHtml in the beta release, we won't be using RenderCanvas.
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.
Does it mean we do not have a WebForms version for GetGridHtml?
Thanks
Sean
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
Many thanks, Dennis! I will take a look.
Sean
Confirmed it is working. Thanks!
Sean
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
CurrentPage.GetGridHtml("pageContentLayout");
}
is working on a reply...