Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# mrt 6/5/2007 5:53 AM
We set up sites for our clients as admin and they login as editor, we want to limit their control and ability to break things, and also to keep the interface very simple.

What i'd like to do though is have an option on the second level nav that allows them to add pages that have all the modules already set on them.

So on the nav the edit button appears, they get a list of pages at that level they can add to or delete from
# mrt 6/5/2007 9:21 AM
what would be the best way to manipulate nodes from an admin page? the PageEngine doesnt exist.

I'm basically using this:
Cuyahoga.Web.Components.CuyahogaContainer c = Cuyahoga.Web.Util.ContainerAccessorUtil.GetContainer();
INodeService nodeService = c.Resolve<INodeService>();

would there be a better way?
# martijnb 6/5/2007 9:44 AM
Isn't it an option to create this functionality as a module? So you don't have create new admin pages.
# mrt 6/5/2007 10:11 AM
yes sorry, i am using a module. I meant the admin page of the module.

I've created a module called StructureEditor, it outputs nothing in the ascx but the edit button appears. Then in StructureEditorAdmin.aspx there is a list of pages which i've got using the code above and with this
this.rptPages.DataSource = nodeService.GetNodeByShortDescriptionAndSite("services", this.Section.Node.Site as Site).ChildNodes;
Obviously that string will be configurable later.

Then there is an add page button, it will add a child page with a set template and an instance of the statichtml module attached to a placeholder. I'm trying to figure out how to do this from the admin scripts, so far it's looking like this
            Node newPage = new Node();
            newPage.Title = "Test Page";

            Section staticHTML = new Section();
            staticHTML.ModuleType = (ModuleType)CoreRepository.GetObjectById(typeof(ModuleType), Int32.Parse(1));
            newPage.Sections.Add(staticHTML);

            nodeService.SaveNode(newPage);
# martijnb 6/5/2007 10:49 AM
Allright, looking good so far. I'd just not use the CoreRepository anymore because it's deprecated. Use ICommonDao instead for generic data-access stuff.

# mrt 6/5/2007 1:19 PM
thanks! all working great, except when I add a node the cache won't update for about a minute, i've tried all these:
                base.CoreRepository.FlushSession();
                base.CoreRepository.ClearCache(n.GetType());
                CoreRepository.ClearQueryCache("Nodes");

works fine when deleting a node, but not when updating. any ideas?

thanks
# martijnb 6/5/2007 4:29 PM
Strange. The ClearCache and ClearQueryCache methods should take care of this. At least, that's how I solved the issue in the past.
# Muttok 6/6/2007 8:50 AM

Would like to share your "allow moderators to add pages" module?
I also need a similar module for a upcoming site.