Tuesday, August 22, 2006

Advanced delete with link cleanup

A common question I get asked when demonstrating EPiServer to potential clients is:

How does EPiServer handle links when deleting a page? Does EPiServer clean up potential broken links?

With the standard EPiServer delete function there is no link cleanup, which means you can easily end up with broken links. Now this is something that I thought would be easy in EPiServer, as the standard function even tells you what the linked pages are when you try to delete. So, why is there no ability to clean up the links before delete? Answer, I don't know, but maybe it will be coming in a future version :)

The standard delete function
[The standard delete function]

Well I want it now! So this is the driver behind my want to create an advanced delete function, that gives the user the ability to clean up links before a page is deleted.

I have started work on a prototype, and it's working quite well so far. My delete page plugs into EPiServer using the "alternate files" function (a function that allows you to implement your own version of an admin or edit mode function). This means my advanced delete overrides the standard delete and is available through the standard menus.

If a link to the selected page is detected, then some options are supplied to either remove the links or replace the links. And for the web admins out there, I have added an option so you can force the user to clean up all links, before the page can be deleted (you know you want the power).

Here are a couple of screenshots from my current prototype:

Standard delete menus
[The standard delete menu activating the advanced delete function]
My new advanced delete function
[The advanced delete function with force link cleanup enabled]

It works okay at the moment but there are a few things I'd like to improve on, such as
  1. Better detection of linked pages (works well at the moment but a little problem with caching in EPiServer maybe?).
  2. Add override function for site Administrators.
  3. Better access denied handling for when users try to cleanup links on a page they don't have access to.
Anyway, I have added the prototype to EPiCode so if your not already registered, then go register now and download a copy today! Also, if you think of other things that could improve it, then add a comment or add a ticket in EPiCode.

No comments: