Access XML property data of custom data type using dynamic object
Hi,
I'm just getting started with Umbraco, and I've just created my first custom data type. The data of this custom type is stored correctly as XML in the dataNtext column of the "cmsPropertyData" table. When using the XMLDump package to investigate the output XML, the XML data of the custom type seems to be incorporated correctly in the XML tree. However, when I try to access the data (using a statement like @Model.CustomDT.TestNode) I get the following exception:
'umbraco.MacroEngines.DynamicXml' does not contain a definition for 'TestNode'
I've tested similar code for some of the uComponents data types, which also store their data using XML, and it doesn't seem to be working for those either.
Does this mean that the dynamic object used by Umbraco cannot look into the XML data of custom types?
Thanks for your quick reply. I just managed to figure out what I did wrong: The root node of the XML output of the data type is substituted by the alias of the custom data type. So "@Model.customDT.TestNode.aProperty" should actually be "@Model.customDT.aProperty".
Access XML property data of custom data type using dynamic object
Hi Jordan, yes you should be able to do that. Can you provide some samples of the XML stored in the datatype and the Razor code in the Macro?
Hi Alex,
Thanks for your quick reply. I just managed to figure out what I did wrong: The root node of the XML output of the data type is substituted by the alias of the custom data type. So "@Model.customDT.TestNode.aProperty" should actually be "@Model.customDT.aProperty".
is working on a reply...