Beispiel #1
0
        public static void AddFolder(string Path, string Title, Nullable <int> ParentId)
        {
            InventioNavigationNode NewNode = new InventioNavigationNode();

            NewNode.NodeType = InventioNavigationNodeType.Folder;
            NewNode.ParentId = ParentId;
            NewNode.Url      = Path + "/" + Tc.Inventio.Framework.Web.UrlHelper.Slug(Title);
            NewNode.Title    = Title;
            NavigationWorker.Add(NewNode, NavigationWorker.RepositoryWebConfig);
        }
Beispiel #2
0
        public static void AddPage(string Path, string title, int IdLayout, Nullable <int> ParentId)
        {
            bool ok = !string.IsNullOrWhiteSpace(Path) && !string.IsNullOrWhiteSpace(title);

            if (ok)
            {
                // añadimos página
                InventioPage NewPage = new InventioPage();
                NewPage.Path     = Path + "/" + Tc.Inventio.Framework.Web.UrlHelper.Slug(title);
                NewPage.Title    = title;
                NewPage.IdLayout = IdLayout;
                PageWorker.Add(NewPage, PageWorker.RepositoryWebConfig);

                // añadimos entrada en navigation
                InventioNavigationNode NewNode = new InventioNavigationNode();
                NewNode.NodeType = InventioNavigationNodeType.Page;
                NewNode.ParentId = ParentId;
                NewNode.Url      = NewPage.Path;
                NewNode.Title    = title;
                NavigationWorker.Add(NewNode, NavigationWorker.RepositoryWebConfig);
            }
        }