Hi NiQ, you'll have to find out how the info is stored in the cached xml. Open up the /App_Data/umbraco.config file and search for your document (and property of type embedded content). Most probably it's stored as xml, so you use
var document = XDocument.Parse(currentNode.GetProperty("alias").Value.ToString());
It would also be great if someone could help me with geting the URL of the imagename. I manage to get the imagename in a variable but what I need is the images url. :)
Embedded Content in codebehind, get all properties?
Im using currentNode.GetProperty().Value to get the value from my Embedded Content but how do I get all the properties?
I have "image", "text" and "link" set but I don't have a clue how to loop through all the images and print out the properties...
Hi NiQ, you'll have to find out how the info is stored in the cached xml. Open up the /App_Data/umbraco.config file and search for your document (and property of type embedded content). Most probably it's stored as xml, so you use
and use linq 2 xml to query the data stored.
Cheers,
/Dirk
Yeah that worked. I now get both the image, text and link of all three images I have embedded in the property but they all are merged into one string.
In Umbraco I have three images attached to this property, are there anyway I can split this variable so I can make a loop?
It would be great if I could do a foreach loop with the images that are assigned to this property.
Can you show what you get as xml?
Cheers,
/Dirk
<data>
<floatimages>
<item id="1">
<text propertyid="3">Food</text>
<image propertyid="1">1175</image>
<url propertyid="2">1173</url>
</item>
<item id="2">
<text propertyid="3">Image2</text>
<image propertyid="1">1176</image>
<url propertyid="2" />
</item>
<item id="3">
<text propertyid="3">Image3</text>
<image propertyid="1">1177</image>
<url propertyid="2" />
</item>
</data>
</floatimages>
There.
It would also be great if someone could help me with geting the URL of the imagename. I manage to get the imagename in a variable but what I need is the images url. :)
I just noticed I only got the "text" property value due to the fact im using this code:
How do I loop them trough to be able to get acces to both "text", "image" and "url"?
And also, "url" isn't actually the url of the image.. don't really know how to get url.. any help on this would be awesome.
is working on a reply...