Using a macro in my page template STOPS page contents from rendering
Here is the relevant markup in my Page template:
<!-- SIDE NAV: The sideNav property is an ultimate picker value. The value is the id of a SideNaveMenu document. When I include this macro in the template, the contents field below doesn't render anything!-->
Are you sure it doesn't render somewhere - have you tried searching the "View Source" (*not* Web Inspector/Firebug - the actual source) for the contents?
E.g. if there's a tag that's not being closed correct from the @Html.Raw() output - the rest of the page could very easily be effectively "hidden"...
Pardon my "cleverness" - I got tangled up in the RenderTemplate() stuff and forgot the initial question :-)
So what I could imagine *might* be happening, is that the RenderTemplate() somehow makes the Item tag look for the contents property on the page you passed to RenderTemplate()? Does that make sense? Could you try swapping "contents" with the name of a field on the sideNav document and see if that's the case?
Admittedly it would be a weird bug, but hey - it's a computer program :-)
Using a macro in my page template STOPS page contents from rendering
Here is the relevant markup in my Page template:
<!-- SIDE NAV:
The sideNav property is an ultimate picker value.
The value is the id of a SideNaveMenu document.
When I include this macro in the template, the contents field below
doesn't render anything! -->
<umbraco:Macro runat="server" language="cshtml">
@Html.Raw(umbraco.library.RenderTemplate(int.Parse(Model.sideNav)))
</umbraco:Macro>
<!-- CONTENTS:
RichTextEditor field -->
<umbraco:Item field="contents" runat="server" />
Please help.
Add "?umbDebugShowTrace=true" to the URL of a page that is failing and scroll down to see if any errors are thrown.
Example: www.mysite.com/about/my-broken-page?umbDebugShowTrace=true
Cheers,
Drew
Hi Ronnie,
Are you sure it doesn't render somewhere - have you tried searching the "View Source" (*not* Web Inspector/Firebug - the actual source) for the contents?
E.g. if there's a tag that's not being closed correct from the @Html.Raw() output - the rest of the page could very easily be effectively "hidden"...
/Chriztian
@Drew - That doesn't add any additional output.
@Chriztian - No, the HTML is not being rendered at all.
Hi Ronnie,
Does the sideNav document have a template defined? Otherwise, you might need to supply a templateId as the 2nd argument:
/Chriztian
Yes, Chriztian, it does and it works. The issue isn't that the side nav doesn't show up.
The problem I'm having is that when I include that inline macro, it causes the page field called contents to stop being rendered.
Hi Ronnie,
Pardon my "cleverness" - I got tangled up in the RenderTemplate() stuff and forgot the initial question :-)
So what I could imagine *might* be happening, is that the RenderTemplate() somehow makes the Item tag look for the contents property on the page you passed to RenderTemplate()? Does that make sense? Could you try swapping "contents" with the name of a field on the sideNav document and see if that's the case?
Admittedly it would be a weird bug, but hey - it's a computer program :-)
/Chriztian
It's a wierd and buggy computer program.
I'll check into that today...
Thanks.
is working on a reply...