示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Assert.ArgumentNotNullOrEmpty(ItemPaths.AboutUs, "About Us path null or empty");
            Assert.ArgumentNotNullOrEmpty(ItemPaths.Legal, "legals path null or empty");
            Assert.ArgumentNotNullOrEmpty(ItemPaths.PressLanding, "Press landing path null or empty");

            AboutUs.Path = ItemPaths.AboutUs;
            Legals.Path = ItemPaths.Legal;
            Press = Sitecore.Context.Database.GetItem(ItemPaths.PressLanding);

            //Set Header type param if available
            string rawParameters = Attributes["sc_parameters"];
            NameValueCollection parameters = Sitecore.Web.WebUtil.ParseUrlParameters(rawParameters);
            if (!String.IsNullOrEmpty(parameters["HeaderIsH2"]))
            {
                HeaderIsH2 = Convert.ToBoolean(parameters["HeaderIsH2"]);
            }
            //Set CSS class if available
            if (!String.IsNullOrEmpty(parameters["CssClass"]))
            {
                CssClass = parameters["CssClass"];
            }

            GetPartners();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                PressLandingItem landing = new PressLandingItem(Sitecore.Context.Item.Axes.SelectItems(String.Format("ancestor-or-self::*[@@tid = '{0}' ]", PressLandingItem.TemplateId))[0]);
                List<PressArticleItem> pressArticles = landing.InnerItem.Axes.SelectItems(String.Format("descendant::*[@@tid='{0}']", PressArticleItem.TemplateId)).ToList().ConvertAll(X => new PressArticleItem(X));
                pressArticles.Sort((x, y) => y.Date.DateTime.CompareTo(x.Date.DateTime));

                //We have a max number latest article items, remove anything over that number
                if (!String.IsNullOrEmpty(landing.Maxlatestreleases.ToString()))
                {
                    if (pressArticles.Count > landing.Maxlatestreleases.Integer)
                    {
                        pressArticles.RemoveRange(landing.Maxlatestreleases.Integer - 1, pressArticles.Count - landing.Maxlatestreleases.Integer);
                    }
                }

                LatestPressArticleList.DataSource = pressArticles;
                LatestPressArticleList.DataBind();
            }
            catch (Exception ex)
            {
                Log.Error(String.Format("Error retriving popular article list: {0}", ex.Message), this);
                mm.virginactive.common.EmailMessagingService.ErrorEmailNotification.SendMail(ex);
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Landing = new PressLandingItem(Sitecore.Context.Item);

            //Pager settings-----
            NextPreviousPagerField fldPrev = ArticlePager.Fields[0] as NextPreviousPagerField;
            NextPreviousPagerField fldNext = ArticlePager.Fields[2] as NextPreviousPagerField;

            fldPrev.PreviousPageText = Translate.Text("Prev");
            fldNext.NextPageText = Translate.Text("Next");

            //Set pager size
            if (!String.IsNullOrEmpty(Landing.Articlesperpage.Integer.ToString()))
            {
                pageSize = Landing.Articlesperpage.Integer;
                ArticlePager.PageSize = pageSize;
            }

            //------------------

            BindData();
        }