Feature Proposal: Usability: Auto-create page on view if it does not exist
Motivation
Some TWiki applications need to create pages based on specific templates. It is not always possible to created pages ahead of time. It would be nice to be able to link to a topic, and in case it does not exist, have the topic created based on a specific template when clicking on the link.
Use-case example: The
UserBookmarks feature has a link to bookmark the current page. That link points to the <wikiname>Bookmarks page, which has a form pre-filled with the page and name of the to-be-bookmarked page. In case the user bookmarks page does not exist it needs to be created first before showing the topic with the pre-filled form.
Description and Documentation
Add a new
createifnotexist=1 parameter to the
view (and
viewauth) script. If set to
1, the
view script checks if the topic exist. In case not, it redirects to the
save script, passing along the parameters except
createifnotexist. The
save script redirects back to the view script with the same topic (unless redefined by the
redirectto parameter.
Examples
Impact
Implementation
--
Contributors: PeterThoeny - 2011-06-22
Discussion
This is now accepted by the 7 days feedback period.
--
PeterThoeny - 2011-06-30
This is now in
SVN trunk.
--
PeterThoeny - 2011-07-02