Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • René Andersen 238 posts 684 karma points
    Jun 13, 2013 @ 12:24
    René Andersen
    0

    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.

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using DigibizAdvancedMediaPicker;

    @{
    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"/>

    <p>@empdata.GetProperty("employeeMail").Value</p>
    <p>Telefon: @empdata.GetProperty("employeePhone").Value</p>
    }
    }
    }
    }
    }
    }
    }


    Thanks in advance!

    //René,

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jun 17, 2013 @ 13:00
    Jeroen Breuer
    0

    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

  • René Andersen 238 posts 684 karma points
    Jun 18, 2013 @ 09:28
    René Andersen
    0

    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é

Please Sign in or register to post replies

Write your reply to:

Draft