I have recently upgrade to 4.7.1 and I am pretty sure that this did not happen then. I am trying to render a image tag for a document type "MediaElement" that captures the "Media" and "Thumbnail". Media and Thumbnail are both files picked using the S3 plugin. However I am not getting the correct value back from the dynamicNode in razor.
The value of the element.PropertiesAsList[3] (which corresponds to the "Media" node is correct. Notice that the "-" has been removed from the InnerText of the element.Media version (causing invalid data). So when I try to render my node using this bit of razor, it renders an invalid value for the src of my image tag.
var mediaUrl = XDocument.Parse(element.Media.ToXml()).Element("value").Value;
var thumbnailUrl = XDocument.Parse(element.Thumbnail.ToXml()).Element("value").Value;
// This doesn't work either// var mediaUrl = element.Media.BaseElement.Value;// var thumbnailUrl = element.Thumbnail.BaseElement.Value;
Here is a snipped from the umbraco.config for this node
Dynamic Properties invalid in Razor
Hi,
I have recently upgrade to 4.7.1 and I am pretty sure that this did not happen then. I am trying to render a image tag for a document type "MediaElement" that captures the "Media" and "Thumbnail". Media and Thumbnail are both files picked using the S3 plugin. However I am not getting the correct value back from the dynamicNode in razor.
Here are the values that I am seeing in Razor:
element.Media {umbraco.MacroEngines.DynamicXml} base {System.Dynamic.DynamicObject}: {umbraco.MacroEngines.DynamicXml} BaseElement: <value dataTypeId="1135"><![CDATA[cdn.mydomain.com/FIG 1 TB HOCM MMODE AV.004.004.jpg]]></value> InnerText: "cdn.mydomain.com/FIG 1 TB HOCM MMODE AV.004.004.jpg" element.PropertiesAsList[3] {<value dataTypeId="1135"><![CDATA[cdn.mydomain.com/FIG 1 TB HOCM M-MODE AV.004.004.jpg]]></value>} Alias: "media" Value: "<value dataTypeId=\"1135\"><![CDATA[cdn.mydomain.com/FIG 1 TB HOCM M-MODE AV.004.004.jpg]]></value>" Version: {00000000-0000-0000-0000-000000000000}The value of the element.PropertiesAsList[3] (which corresponds to the "Media" node is correct. Notice that the "-" has been removed from the InnerText of the element.Media version (causing invalid data). So when I try to render my node using this bit of razor, it renders an invalid value for the src of my image tag.
Here is a snipped from the umbraco.config for this node
Does anyone have any ideas about how I can fix this?
Thank you,
Justin
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.