Copied to clipboard

Flag this post as spam?

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


  • Sebastian Dammark 583 posts 1407 karma points
    Apr 19, 2017 @ 08:07
    Sebastian Dammark
    0

    Looping through page properties

    How do I loop through properties of a node ?

    This is my code, and right now I add name, url and date manually.

    I've tried to do a nested loop but it fails.

    foreach (var item in events)
    {
        items.Add(
            new {
                name = item.Name,
                url = item.Url,
                date = umbraco.library.FormatDateTime(item.GetPropertyValue("eventDate").ToString(), "yyyy-MM-ddTHH:mm")
            }
        );
    }
    

    Any ideas ?

Please Sign in or register to post replies

Write your reply to:

Draft