Copied to clipboard

Flag this post as spam?

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


  • Grant Stephen 5 posts 85 karma points
    Apr 28, 2021 @ 08:04
    Grant Stephen
    0

    Nested content on other pages

    looking for help , i have a meetings page with a nested content containing an element with meeting Date and meeting title, i can show the meetings on the meeting page (i use a partial) how can i get the partial to render on another page with top 5 meetings partial code below @{ var meetingitems = Model.Value<>

            foreach (var meeting in meetingitems)
            {
    
    
                var meetingdate = meeting.Value<DateTime>("MeetingDate");
                var meetingDay = meeting.Value<DateTime>("MeetingDate").ToString("dd");
                var meetingMonth = meeting.Value<DateTime>("MeetingDate").ToString("MMM");
                string meetingName = meeting.Value<string>("MeetingTitle");
    
                if (meetingdate >= currentdate)
                {
    
                    <div class="row mb-4">
                        <div class="col-lg-12 ">
                            <span class="date">
                                <span class="month rounded-top scouts-blue">
                                    @meetingMonth
                                </span>
                                <span class="day border rounded-bottom">
                                    @meetingDay
                                </span>
                            </span>
                            @meetingName
    
                        </div>
    
                    </div>
                }
    
    
            }
        }
    

    thanks in advance

    G

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Apr 28, 2021 @ 09:07
    Alex Skrypnyk
    100

    Hi Grant

    You just need to retrieve the page with meetings =

    var meetingitems = meetingsPage.Value<>;
    

    To make it you can get the page by Id, by Alias, traverse over the tree, check out helper methods for such cases - https://our.umbraco.com/documentation/reference/querying/umbracohelper/

    Thanks, Alex

Please Sign in or register to post replies

Write your reply to:

Draft