Question
I have a TWiki set up, and when a new topic is created, the user can select one of several different templates to help structure different types of documents. However if a new topic is created by clicking on a ? after a
WikiWord, they start creating the new Topic in the default template. Is there any way to direct the browser to the appropriate webs
WebTopicViewTemplate instead of
WebTopicEditTemplate.
Thanks.
--
TomMcMillen - 08 Nov 2001
Answer
I've worked this one out myself now. I've changed line 1690 in TWiki.pm to read
/view$scriptSuffix/$theWeb/?topic=$theTopic
instead of
/edit$scriptSuffix/$theWeb/$theTopic?topicparent=
That does the trick. Although it may be nice if this could be set from a TWiki Variable at some point in the future.
--
TomMcMillen - 09 Nov 2001
Here's an easier way, based on above, but using a variable. Edit
TWikiPreferences to change NEWLINKFORMAT to:
* Set NEWLINKFORMAT = $text<A }%="" topic="" this="" create="" title="%MAKETEXT{" rel="nofollow" ?topic="$topic"" $web="" view="" href="%SCRIPTURLPATH%7B">?
(You may have to open this page in the editor to see the correct text to use.)
Instead of the editor, you get an error page that prompts the user to search for similar pages,
or to create it (via another page, which does prompt for templates).
--
ClifKussmaul - 06 Apr 2008
Above NEWLINKFORMAT seems to be garbled.
--
PeterThoeny - 06 Apr 2008
Based on the above NEWLINKFORMAT suggestion, I modified the variable's settings in
TWikiPreferences so that clicking on the ? takes the user to the
WebCreateNewTopic page so that he/she can pick the appropriate parent and/or topic template.
The NEWLINKFORMAT is set as follows:
<span class="twikiNewLink">$text<a href="%SCRIPTURLPATH{"view"}%/$web/$topic?create=on&newtopic=$topic&template=WebCreateNewTopic&topicparent=">?</a></span>
--
GarySprague - 18 Jun 2008