示例#1
0
        private void AddPagesFromDb(string site, string rootPath)
        {
            var pageTemplatesJson = new Json <Templates>(rootPath);

            templates = pageTemplatesJson.ReadJsonObject(pageTemplatesJson.ReadFile(site + "/CMSdata/pages", "pageTemplates.json"));

            RepoBase repo = RepoBase.RepoFactory(site, context, rootPath);

            if (repo == null)
            {
                throw new Exception("Repo not defined");
            }

            var repoPages = repo.GetPageSummaryFromDb(true);

            foreach (var repoPage in repoPages.pages)
            {
                this.pages.Add(repoPage);
            }
        }