I need to have some data and a image in the Root node. I have no problem getting the text from the Root to show up on my website. But I dont know how to get the image show on the website using DAMP. Below you can see the code I am using where all the basic stuff works fine but when I get to the line "img src" something goes wrong and no image shows up.
@{ var rootNode = new umbraco.MacroEngines.DynamicNode(-1);
foreach (var item in rootNode.Children) { if (item.NodeTypeAlias == "Data") { foreach (var data in item.Children) { if (data.NodeTypeAlias == "EmployeeBase") { foreach (var empdata in data.Children) { if (empdata.NodeTypeAlias == "Employee") { dynamic media = Model.MediaById(Model.imageDamp); <img src="@media.umbracoFile" alt="@media.nodeName"/>
Could you show a part of your xml so I might be able to see what goes wrong? Did you try any of the examples which also show how it works? For example:
Get image from Rote Node / DynamicNode
Hi
I need to have some data and a image in the Root node. I have no problem getting the text from the Root to show up on my website. But I dont know how to get the image show on the website using DAMP.
Below you can see the code I am using where all the basic stuff works fine but when I get to the line "img src" something goes wrong and no image shows up.
Thanks in advance!
//René,
Hello,
Could you show a part of your xml so I might be able to see what goes wrong? Did you try any of the examples which also show how it works? For example:
DAMP 2.5 Samples: Video - http://www.screenr.com/gz0s
DAMP Gallery: Video - http://www.screenr.com/1Vx7
Jeroen
Hi Jeroen
I think I am pretty close to a solution. I will post it here as soon as possible.
By the way i have looked at the examples.
// René
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.