private void Page_Load(object sender, EventArgs e) { Item team = SiteConfiguration.GetTeamItem(); if (team != null && team.Template.Key == "team section") //TODO: The team list should not show anything unless it is the team section. This is enforced in page editor using placeholder settings. { rptList.DataSource = team.Children.ToArray().Where(item => SiteConfiguration.DoesItemExistInCurrentLanguage(item)); rptList.DataBind(); } }
public ActionResult TeamList() { /* Populate with: Children of Datasource OR Children of Current */ Item team = SiteConfiguration.GetTeamItem(); if (team != null && team.Template.Key == "team section") { IEnumerable <SimpleItem> items = new SimpleItem(DataSourceItemOrCurrentItem).ChildrenInCurrentLanguage; return(!items.IsNullOrEmpty() ? View(items) : null); } return(null); }