This project is read-only.

Override edit url

Oct 13, 2008 at 10:35 PM
I want to implement a custom edit page for some items, is there a smart way to override the edit url?
Oct 13, 2008 at 11:36 PM
It's not terribly smart I'm afraid but you have options:
  1. Implement an IEditManager e.g. by overriding GetEditNewPageUrl and GetEditExistingItemUrl in the EditManager class and configure it as a service
  2. Configure <n2><edit editItemUrl="..." and do some redirects
Oct 14, 2008 at 8:24 AM
Edited Oct 14, 2008 at 8:31 AM
If it works it's smart!
I kinda found the last one the most smart...but it does not seem to work...
The edit and add url stays the same when I change them in the <n2><edit attributes:
<edit editTreeUrl="Navigation/Tree.aspx" editPreviewUrlFormat="{0}" editItemUrl="~/Secured/redir/edit.aspx" newItemUrl="~/Secured/redir/new.aspx" editInterfaceUrl="~/edit/default.aspx" deleteItemUrl="~/edit/delete.aspx" enableVersioning="true">

they still point to the original url's in the edit-mode...
Oct 14, 2008 at 9:59 PM
Sorry, I realised those links are defined as plugins:
    [NavigationLinkPlugin("Edit", "edit", "../edit.aspx?selected={selected}", Targets.Preview, "~/edit/img/ico/page_edit.gif", 20, GlobalResourceClassName = "Navigation")]
    [ToolbarPlugin("", "edit", "edit.aspx?selected={selected}", ToolbarArea.Preview, Targets.Preview, "~/Edit/Img/Ico/page_edit.gif", 50, ToolTip = "edit", GlobalResourceClassName = "Toolbar")]

I should probably fix this... If you're willing to go dirty a workaround would be changing the appropriate plugin in here: Engine.Resolve<IPluginFinder>
Oct 14, 2008 at 11:03 PM
Thanks, implemented the dirty workaround for both edit and new.