sec.GetGridHtml() throws a runtime error... Does not exist. I tried CurrentPage.GetGridHtml() and same results are my previous attempts... no errors, but no output at all.
Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'GetGridHtml'
Can I render GetGridHtml in a partial
I would like to be able to render a GetGridHtml in a partial. IS there a way to achieve this?
This is my current partial:
Tree Structure
Hi Phillip,
Could you try this
@sec.GetGridHtml("bodyContent")
Hope this helps,
/Dennis
I tried... it renders empty.
If I omit the GetGridHtml method, then the correct JSON is returned, but applying the method fails. Note that is does not give a runtime error.
Hi,
try
Sometimes the razor "renderer" need a bit of a hint where the tag ends.
Unfortunately that didn't work either. The output is blank. So the JSON is going somewhere and no runtime error is occurring.
Re-reading your code - what is making up these sections? Are you using LeBlender or something similar to create reoccuring sections?
Steve
No.
Each section is a document type called "page-section" and has no template.
When the parent template is called, I call @Html.Partial("page-section"), which is the code I posted.
Here is the code to the template:
I am wondering if the GetGridHtml() is a help method for only templates and not partials and if I am missing a reference.
Sorry - re-reading again - your "sections" are actually child nodes, right? If so try:
...
yes, they are children!
sec.GetGridHtml() throws a runtime error... Does not exist. I tried CurrentPage.GetGridHtml() and same results are my previous attempts... no errors, but no output at all.
Hi,
CurrentPage is dynamic and I think causing you your issues.
Try a cut back version of your partial page-sections - NOTE how I'm using the strongly typed Model.Content.Children():
I've just tested this locally and it works as expected.
ok, that worked. This is what I was doing wrong:
and not
Thanks for the replies
Glad you're sorted!
is working on a reply...