[Pmwiki-users] Rewriting the edit page link

Patrick R. Michaud pmichaud
Sat Dec 18 08:03:12 CST 2004

On Sun, Dec 19, 2004 at 02:51:54AM +1300, Robin wrote:
> Hash: SHA1
> Hi, further on my previously-mentioned project, how can I re-write the edit 
> page link? Basically I want to insert some javascript into it to do browser 
> detection to see if it should redirect to an editxul action or not (obviously 
> keeping the href for non-javascripted browsers. I use lynx sometimes, too :)

If you mean the "Edit Page" link that appears as part of the page skin,
then the answer is to modify the skin to use the javascript.  There's
not a universal way to set the "Edit Page" link for all skins.

Another possibility might be to intercept "?action=edit", check the browser
capabilities, and if appropriate redirect to ?action=editxul:

   if ($action == 'edit') 
     if (/*browser supports xul*/) 
       Redirect($pagename, '$PageUrl?action=editxul');

More information about the pmwiki-users mailing list