public DynamicPageFormulaItem(Agility.Web.AgilityContentServer.AgilityPage page, string contentReferenceName, string languageCode, DataRow row)
        {
            DataTable dt = row.Table;

            //resolve the formulas...
            MenuText     = ResolveFormula(page.DynamicPageMenuText, row, false);
            Title        = ResolveFormula(page.DynamicPageTitle, row, false);
            Name         = ResolveFormula(page.DynamicPageName, row, true);
            LanguageCode = languageCode;


            DateTime lastModified = DateTime.MinValue;
            object   o            = row["CreatedDate"];

            if (o is DateTime)
            {
                lastModified = (DateTime)o;
            }
            else
            {
                DateTime.TryParse($"{o}", out lastModified);
            }

            LastModifiedDate = lastModified;

            ContentReferenceName = contentReferenceName;
            int id = -1;

            if (!int.TryParse($"{row["ContentID"]}", out id))
            {
                id = -1;
            }
            ContentID = id;

            VisibleOnMenu    = page.DynamicPageVisibleOnMenu;
            VisibleOnSitemap = page.DynamicPageVisibleOnSitemap;


            if (dt.Columns.Contains("DynamicPageVisibleOnMenu") &&
                !row.IsNull("DynamicPageVisibleOnMenu"))
            {
                VisibleOnMenu = string.Format("{0}", row["DynamicPageVisibleOnMenu"]).ToLowerInvariant() == "true";
            }

            if (dt.Columns.Contains("DynamicPageVisibleOnSitemap") &&
                !row.IsNull("DynamicPageVisibleOnSitemap"))
            {
                VisibleOnSitemap = string.Format("{0}", row["DynamicPageVisibleOnSitemap"]).ToLowerInvariant() == "true";
            }

            //add the meta and script stuff...
            if (dt.Columns.Contains("DynamicPageMetaKeywords"))
            {
                MetaKeyWords         = row["DynamicPageMetaKeywords"] as string;
                MetaDescription      = row["DynamicPageMetaDescription"] as string;
                AdditionalHeaderCode = row["DynamicPageAdditionalHeaderCode"] as string;
                TopScript            = row["DynamicPageTopScript"] as string;
                BottomScript         = row["DynamicPageBottomScript"] as string;
            }
        }
Example #2
0
 public ResolvedPage(AgilityPage page, DynamicPageFormulaItem dynamicPageItem)
 {
     Page            = page;
     DynamicPageItem = dynamicPageItem;
 }
Example #3
0
 public ResolvedPage(AgilityPage page)
 {
     Page = page;
 }