Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
I am in need of a content context in my nupicker datatype to be passed to the macroviewpage.
I have added contextId via parameters but that's only set in an existing node.
Is there any way to see the parentid for a new node? Or is it just not possible?
Thanks! Erik
well of course in the case of a MacroViewPartial being called from nuPickers, there's a always a request object :)
This does the job for me:
@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var contextContent = Umbraco.TypedContent(Model.MacroParameters["contextId"]); if (Model.MacroParameters["contextId"] == null) { if (Request.QueryString["parentId"] != null) { var parentContent = Umbraco.TypedContent(Request.QueryString["parentId"]); if (parentContent != null) { contextContent = parentContent; } } } }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Content context or parent in new node
Hi all,
I am in need of a content context in my nupicker datatype to be passed to the macroviewpage.
I have added contextId via parameters but that's only set in an existing node.
Is there any way to see the parentid for a new node? Or is it just not possible?
Thanks! Erik
well of course in the case of a MacroViewPartial being called from nuPickers, there's a always a request object :)
This does the job for me:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.