Copied to clipboard

Flag this post as spam?

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


  • Michael Falch Madsen 70 posts 92 karma points
    May 16, 2011 @ 21:38
    Michael Falch Madsen
    0

    Loop Embeded Content

    How do i loop Embedded Content From TheFARM in a usercontrol (C#)

  • Artem 4 posts 24 karma points
    Feb 24, 2012 @ 11:56
    Artem
    0

    Great oportunity gives include

    using umbraco.MacroEngines;

    which will give us possibility to use DynamicNode class and other powerful toys.

    Than we can do next

    dynamic property = node.HasProperty("property") && node.HasValue("property")
    ? node.GetPropertyValue("property")
    : null;
    if (property != null)
    {
    //primaly content is Xml and can be loaded into umbraco.MacroEngines.DynamicXml object
    dynamic propertyDynamicXml = new DynamicXml(property);
    //item in foreach loop is also from class umbraco.MacroEngines.DynamicXml
    foreach (var item in propertyDynamicXml)
    {
    string name = item.BaseElement.Element("name") != null
    ? item.BaseElement.Element("name").Value
    : string.Empty;
    }
    }
  • 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.

Please Sign in or register to post replies