V7.2.1 Umbraco Core Property Value Converters (UCPVC) installed
I know this is to do with Archetype but there's no problem if I don't have UCPVC installed. So........
I have an Archetype field set which I can get an image from a Media Picker ok but am unable to retreive a simple textbox value. I know that when I haven't had UCPVC installed, in the following code, to get the H4 I'd just use fieldset.GetValue("subSectionTitle"). I'm afraid I can't work out how to get to it with the UCPVC installed.
Compiler Error Message: CS1061: 'Archetype.Models.ArchetypeFieldsetModel' does not contain a definition for 'GetProperty' and no extension method 'GetProperty' accepting a first argument of type 'Archetype.Models.ArchetypeFieldsetModel' could be found (are you missing a using directive or an assembly reference?)
How to retrieve value from Archetype fieldset?
V7.2.1 Umbraco Core Property Value Converters (UCPVC) installed
I know this is to do with Archetype but there's no problem if I don't have UCPVC installed. So........
I have an Archetype field set which I can get an image from a Media Picker ok but am unable to retreive a simple textbox value. I know that when I haven't had UCPVC installed, in the following code, to get the H4 I'd just use fieldset.GetValue("subSectionTitle"). I'm afraid I can't work out how to get to it with the UCPVC installed.
Code:-
Result:-
Compiler Error Message: CS1061: 'Archetype.Models.ArchetypeFieldsetModel' does not contain a definition for 'GetProperty' and no extension method 'GetProperty' accepting a first argument of type 'Archetype.Models.ArchetypeFieldsetModel' could be found (are you missing a using directive or an assembly reference?)
Have tried several ways but no luck.
Any clue would be appreciated.
Thanks,
Craig
I think it should be GetValue?
Thanks Jeavon.
You're absolutely right. I deleted this topic within 5 mins of posting it (having tried for an hour). Typo!
Deleting topic doesn't seem to work :(
Craig
No worries, is "icon" a media picker?
Yes
Then you can do this:
var icon = fieldset.GetValue<IPublishedContent>("icon");
Which will use the value converter
er... now it's broke at @icon.GetResponsiveCropUrl("SupportIcon")
:(
No it isn't!
What it is, is time to stop working!
Have good evening, I'm opening a bottle :( !
You too!
is working on a reply...