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
I have a rich text editor in a nested content doc type, where i have a macro with a parameter...
How do i render that parameter in my Partial view macro file?
var myParam = Model.GetParameterValue<string>("citation");
returns:
'PartialViewMacroModel' does not contain a definition for 'GetParameterValue'
var myParam = Model.MacroParameters["citation"];
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
Hi Claushingebjerg
First thought, is the GetParameterValue is still there in V8
https://github.com/umbraco/Umbraco-CMS/blob/853087a75044b814df458457dc9a1f778cc89749/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs
but it's an extension method if you add:
@using Umbraco.Web.Models
to the top of your PartialViewMacro does that make it work?
regards
Marc
Yup, that works perfectly, thank you H5YR
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
Getting macro parameters in v8
I have a rich text editor in a nested content doc type, where i have a macro with a parameter...
How do i render that parameter in my Partial view macro file?
returns:
'PartialViewMacroModel' does not contain a definition for 'GetParameterValue'
returns:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
Hi Claushingebjerg
First thought, is the GetParameterValue is still there in V8
https://github.com/umbraco/Umbraco-CMS/blob/853087a75044b814df458457dc9a1f778cc89749/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs
but it's an extension method if you add:
to the top of your PartialViewMacro does that make it work?
regards
Marc
Yup, that works perfectly, thank you H5YR
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.