Copied to clipboard

Flag this post as spam?

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


  • alexant 22 posts 42 karma points
    Aug 26, 2014 @ 22:34
    alexant
    0

    Get Calendar.GetEvents of a child of the CurrentPage

    I am tring to list the Children of a currentPage and its events apropriate. Just like:

     

    Current Page

       Child1  (Has the calendar property)

             First event of Child1

             Second event of Child1

             ...

             Last event of Child1

        Child2

             First event of Child2

    .... and so on

     

    The Following Code returns no events:

    <code>

    @foreach (var kurschen in CurrentPage.Children)   
        {
        <p>@kurschen.Name</p>
        <ul>
        @foreach (CalendarEvent ce in Calendar.getEvents(DateTime.Now.Date, DateTime.Now.AddDays(365), "skBegin", kurschen ))
            {
            <p>&nbsp;</p>
            <li>    <a href="/projects/website-utilities/ksumbraco7calendar/ksumbraco7calendar/ce.content.Url">
                    @ce.startDate.ToString("dd MMM") - @ce.content.Name
            </a>    </li>
            }
        </ul>
    }

    <code>

  • alexant 22 posts 42 karma points
    Aug 26, 2014 @ 22:36
    alexant
    0

    how can I use the "StartNode" property?

    Is there some way to list the events of a child?

    Thanks

  • Ole Martin Bakke 112 posts 624 karma points
    Aug 27, 2014 @ 21:59
    Ole Martin Bakke
    0

    I'm not sure if i understand you setup, but the calendar property shoud be on the events, not it's parent.

    The startnode-property should be the parent or ancestor for one or more nodes that as the calendar property.

    Hope this answeres your questions.

Please Sign in or register to post replies

Write your reply to:

Draft