how to display the multiple children pages data in parent page episerver cms 7.5


how display child page data in parent page episerver cms 7.5

Apr 27, 2015 8:04


i want in above link  Announcements & Events how to display child pages images in parent page tell me guys

Apr 27, 2015 8:08

PageData pdAnnouncements = GetPage(pgrefAnnouncements);
PageDataCollection rootBanner = GetChildren(pgrefAnnouncements);
DateTime dtExpiryDate;
foreach (PageData pd in rootBanner)
dtExpiryDate = Convert.ToDateTime(pd["ExpiryDate"]);
if (dtExpiryDate == DateTime.MinValue)
dtExpiryDate = DateTime.Now;
if ((System.DateTime.Now > pd.StartPublish) && (System.DateTime.Now < pd.StopPublish))
if (System.DateTime.Now.Date <= dtExpiryDate.Date)
if (pd.VisibleInMenu == true)
if ((System.DateTime.Now > pd.StartPublish) && (System.DateTime.Now < pd.StopPublish))
if (j == 3) { j = 1; } else { j++; }

if (i <= NoAnnouncement)
if (j % 2 == 0)
AnnouncementBlock2 = "<div class=\"announceBoxlft mdlMar\"><img src=\"{0}\" alt=\"\"><div class=\"blueOpacity\"><p>{1}</p> <a href=\"{2}\">read more</a></div><span><a id=\"bluOpacityHover\" href=\"{2}\">{1}</a></span></div>";

announcesrc2 = Convert.ToString(pd.Property["ThumbImage"]);
//announcesrc2 = UrlExtensions.ContentLink(null, pd.Property.ThumbImage) ?? string.Empty;
announceshortdesc2 = Convert.ToString(pd.Property["ShortDescription"])??string.Empty;
AnnouncementBlock2 = string.Format(AnnouncementBlock2, announcesrc2, announceshortdesc2, pd.LinkURL)??string.Empty;
AnnouncementBlock += AnnouncementBlock2;
AnnouncementBlock1 = "<div class=\"announceBoxlft\"><img src=\"{0}\" alt=\"\"><div class=\"blueOpacity\"><p>{1}</p> <a href=\"{2}\">read more</a></div><span><a id=\"bluOpacityHover\" href=\"{2}\">{1}</a></span></div>";
announcesrc1 = Convert.ToString(pd.Property["ThumbImage"]);
announceshortdesc1 = Convert.ToString(pd.Property["ShortDescription"]) ?? string.Empty;
AnnouncementBlock1 = string.Format(AnnouncementBlock1, announcesrc1, announceshortdesc1, pd.LinkURL) ?? string.Empty;
AnnouncementBlock += AnnouncementBlock1;

aboue the code not working

Edited, Apr 27, 2015 8:11
<p>please tell me guys urgent i need</p>
Apr 27, 2015 9:27

Suresh... I'm not quite following what your specific issue is within your series of posts, but regarding your initial post topic...

You can use the IContentRepository interface to get the children of a given ContentReference. For example, if you want to get all children of the StartPage as PageData, you could do this:

var repository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentRepository>();
ContentReference pageLink = ContentReference.StartPage;
IEnumerable<PageData> pages = repository.GetChildren<PageData>(pageLink);

The EPiServer documentation is a great reference and starting point if you are having difficulties developing with EPiServer:

Specifically for your issue, you can see the documentation on this page:


As a side note, if you are continuing to have difficulties developing with EPiServer, I highly recommend looking into taking some training (see EPiServer has created a great course that covers developing with EPiServer... and if it's not available in your area, they have an online course as well!

Apr 27, 2015 19:08
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.