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"}%