I'd like to set "?redirectto=..." parameter to the edit link for all
the topics in the entire web. In order to do that, it would be handy to use a preference variable such as "Set SAVEREDIRECTTO = ..." in the WebPreference
-based push to a separate social system, with which people can keep track of news that someone edits topics in the TWiki web.
As a minor additional enhancement, I'd also like to allow the after-redirect page to detect whether the action was a quiet save or not. For that, I'm considering to make a variable like "$dontnotify" available in the redirectto parameter value, which will respect whether the action was a normal save or a quiet save.
When making "$dontnotify" available, the feature can be a little more generic by making all the formdata parameters for the save script available as variables in the redirectto value. It is slightly concerning because the "dontnotify" parameter is implicitly set within the save script handler (probably because of backward compatibility?) rather than the value is passed via the formdata submitted to the save script.
Description and Documentation
- If SAVEREDIRECTTO pref var is set, the "redirectto" URL param is added to the edit link at the top of the view page.
- If $variables are contained in the "redirectto" parameter value, the variables are expanded based on the formdata submitted to the save script. The "dontnotify" parameter is a special case, where the value is set to "checked" if the action is a quiet save.
* Set SAVEREDIRECTTO = ExampleRedirectHandler?savedTopic=%TOPIC%;dontnotify=$dontnotify
-- Contributors: Mahiro Ando - 2016-06-22
Proposal looks good.
-- Peter Thoeny - 2016-06-23
The proposal looks fine. The only thing I'd suggest is a name for the preference variable which makes clear that the redirection takes place only after a save action.
-- Harald Jörg - 2016-06-24
Good idea Harald.
-- Peter Thoeny - 2016-06-24
Thanks for the suggestion. I agree - bare REDIRECTTO within WebPreferences
could sound ambiguous. I've updated the description with SAVEREDIRECTTO.
-- Mahiro Ando - 2016-07-04