Im trying to use nested conted with "Le blender" to do some serious Grid magic... But i cant get it to render any output.
Using this in a grid view partial:
@using Umbraco.Web.Templates
@inherits UmbracoViewPage<Lecoati.LeBlender.Extension.Models.LeBlenderModel>
@foreach (var item in Model.Items)
{
var items = item.GetPropertyValue<IEnumerable<IPublishedContent>>("institutioner");
foreach(var item in items) {
<p>foo</p>
}
}
i get
"error CS1928: 'Lecoati.LeBlender.Extension.Models.LeBlenderValue' does not contain a definition for 'GetPropertyValue' and the best extension method overload 'Umbraco.Web.PublishedContentExtensions.GetPropertyValue
How do i render nested content in Leblender context?
I've never tried Nested Content with LeBlender before... to be honest, I'm surprised to hear that they are compatible. (As I thought LeBlender was based on macro-parameter-editors).
From the exception message, the problem appears to be how to get the value from the LeBlenderValue object.
Looking on GitHub, the source-code shows that they have a GetValue<T> method.
error CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments
I'm currently developing a block on my current project where i tried using Nested Content for the first time and your last code is working really well! :)
Using with leblender
Im trying to use nested conted with "Le blender" to do some serious Grid magic... But i cant get it to render any output. Using this in a grid view partial:
i get "error CS1928: 'Lecoati.LeBlender.Extension.Models.LeBlenderValue' does not contain a definition for 'GetPropertyValue' and the best extension method overload 'Umbraco.Web.PublishedContentExtensions.GetPropertyValue
How do i render nested content in Leblender context?
Hi Claus,
I've never tried Nested Content with LeBlender before... to be honest, I'm surprised to hear that they are compatible. (As I thought LeBlender was based on macro-parameter-editors).
From the exception message, the problem appears to be how to get the value from the
LeBlenderValue
object.Looking on GitHub, the source-code shows that they have a
GetValue<T>
method.Try using
GetValue
instead ofGetPropertyValue
.Cheers,
- Lee
Yeah, i've been down that route a bit...
if i just do:
i get the json:
if i do:
i get this error:
Is there anything more in the
error CS1502
?This does not work since razorscript breaks of at the first < thinking its an html tag.
You can resolve this by putting the whole statement in ()
The reason why your first code didnt work is because you used .GetPropertyValue instead of GetValue
Nope, its leblender returning the error message, not a full blown error page
is
correct? It looks weirdly nested to me...
Yeah, that's the correct syntax for the type. But I suspect that LeBlender is doing something differently than how Umbraco gets the property value.
The
error CS1502
doesn't really give us much to go on :-(I'd say that this isn't an issue with Nested Content, more how LeBlender is handling the property-value resolution.
Maybe it is best to ask Antoine to join this thread, or raise a new thread on the LeBlender forum?
Thanks,
- Lee
Hi Claus,
I think we had this working in a project, but we used a Leblender controller and it worked in the controller.
Dave
Ok, so i found a way to do it, just if some else need to do the same. Using json.net i parse the raw json from nested content.
Ok im at an absolute loss as to what happened... Suddenly the above json method didnt work anuymore... Now i use this:
why this suddenly works i have no idea. Hopefully it stays this way now...
Thanks Claus! :)
I'm currently developing a block on my current project where i tried using Nested Content for the first time and your last code is working really well! :)
Has anyone got this working ?
I have tried everything above, nothing is working for me with LebLender and Nested Content.
Could you post any more relevant information?
and it doesn't matter if I iterate Model.Item through foreach or as above, any suggestions ?
Another example
Other thing might be that, I am using Multilanguage Vorto plugin which returns different json then above.
returned json:
is working on a reply...