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 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.
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.
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?"
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:
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é
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
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é
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:
Then this:
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?"
I get an error from the bootstrap3.cshtml saying 'string' doesn't have a definition for 'sections':
Any idea what that can be?
Hey Kasper
Got same problem in a Custom GridEditor i made, so did you solve this problem ?
Regards Jan Borup Coyle
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
is working on a reply...