Closed pankajinfo3 closed 4 years ago
Are you using a doctype with a Grid property as a ContentBlock? I imagine that should work as usual. In your code example, is Model
an IContentBlockViewModel<T>
, where T
is your doctype? What is the output of @Html.GetGridHtml()
in your example?
cannot convert from 'Perplex.ContentBlocks.Rendering.IContentBlockViewModel' to 'Umbraco.Core.Models.PublishedContent.IPublishedProperty'
@Html.GetGridHtml(Model, "columnsbuilder")
I am using this way code
I do this code GridValue grid = JsonConvert.DeserializeObject
@Html.GetGridHtml
should be called on IPublishedContent
or IPublishedProperty
, so you should call with Model.Content, right? Model
is indeed the IContentBlockViewModel
so that won't work.
What's the output of @Html.GetGridHtml(Model.Content, "columnsbuilder")
?
I do this code GridValue grid = JsonConvert.DeserializeObject(Model.Content.Value("columnsbuilder").ToString()); to get Grid
Do you want the HTML or the JSON? This code you give will just give you the JSON right? Regardless, anything you do should work the same as on a "normal" Umbraco doctype, as you should be getting the same ModelsBuilder object.
I need HTML
Ah I see, it does not work on IPublishedElement
, that's interesting.
Anyway, try this to use the overload with an IPublishedProperty
:
@Html.GetGridHtml(Model.Content.GetProperty("columnsbuilder"))
wooowww nice it's work :) thanks
also how i add language that manage by Dictionary created control
also how i add language that manage by Dictionary created control
Not sure what you mean by this, but perhaps you can create a new issue for this one and provide some example code. I'll close this one now as it's resolved.
Thanks
How we use Grid option inside and render value using default @Html.GetGridHtml(Model.Content, "columns")