It would be nice if we could define custom URL variables that will be passed on when we click on the 'edit' link. This can be used to set any URL variables that have an effect on how the edit page is rendered. An examples would be to set a custom skin or cover variable.

Another, more interesting example of this is the nowysiwyg variable, which determines whether we initially get the TinyMCE editor or the natedit editor. Combined with the code in Item5159 this gives the user full control over which editor to start with, while keeping the possibility to switch to the other editor during editing.

Changes in NatSkinPlugin.pm

Around line 888, change the code to include the string CUSTOM_EDITURLPARAMS...if defined.

$editUrlParams = '&action=form' unless $whiteBoard;
$editUrlParams = 
   $editUrlParams
   . '%IF{"defined CUSTOM_EDITURLPARAMS" then="%CUSTOM_EDITURLPARAMS%" else=""}%';

Example configuration

Now we can use all the usual tools to define the value of CUSTOM_EDITURLPARAMS. For example, if i want to start the editor in plain text mode then i can use:

   * Set NOWYSIWYG_DEFAULT = 1
   * Set CUSTOM_EDITURLPARAMS = %IF{"defined NOWYSIWYG_DEFAULT" then="&nowysiwyg=%NOWYSIWYG_DEFAULT%&foobar=0" else="&foobar=1"}%


Actually TinyMCEPlugin has got the global variable NOWYSIWYG to disable it without changing the edit url. Is that sufficient?

-- MichaelDaum - 03 Jul 2009

I guess so.

-- MichaelDaum - 20 Aug 2009

ItemTemplate edit

Summary Custom URL variables passed to edit link
ReportedBy TWiki:Main.MarkVanHeeswijk
Codebase
SVN Range TWiki-4.3.0, Tue, 18 Dec 2007, build 16029
AppliesTo Extension
Component NatSkin
Priority Enhancement
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r3 - 20 Aug 2009, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy