Additional Clone Link in More Section

If it is possible to rename and move a topic it shouldn't be impossible to clone a topic (same name - different web or different name - same web.

Copies the whole content except attachments.

But: if you use this to copy the structure of a page, this feature might be an elegant solution for SelectableNewTopicTemplates. This way, you don't even need to set up templates ahead of time.

Approach

instead of reading a template; read another topic.

Just create an URL like so: /twiki/edit/Web/NewTopic?templatetopic=OldTopic

-- PeterKlausner - 03 Apr 2003 + 4 May 2003

Implementation for 2003 versions (probably Cairo)

Add this to the oopsmore.tmpl template:
<form action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%WEB%">
      * Select new =Web.TopicName= <br />
        <select name="web">%WEBLIST{ "        <option $marker>$name</option>"}%
        </select>.<input type="text" name="topic" value="CopyOf%TOPIC%" size="36">
        <input type="hidden" name="templatetopic" value="%TOPIC%">
        <input type="hidden" name="onlynewtopic" value="on">
      * then
        <input type="submit" value="Edit"> and save the new topic<br />
        __Note:__ Topic text excluding attachments is cloned
</form>
and get this:
  • Clone this topic:
    • Select new Web.TopicName
      .
    • then and save the new topic
      Note: Topic text excluding attachments is cloned

This even silently drops attachments -- although I don't understand why.

-- PeterKlausner - 03 Apr 2003 + 4 May 2003

Diff against 4.2.0

*** oopsmore.tmpl.orig  Thu May  1 13:30:01 2008
--- oopsmore.tmpl       Thu May  1 13:40:25 2008
***************
*** 32,38 ****
       %MAKETEXT{"scans links in _[_1] web_ only" args="%WEB%"}%
  %TMPL:END%
  
! 
  
  %TMPL:DEF{"backlinks"}%---+++ %MAKETEXT{"Backlinks"}%
     * <b><a href="%SCRIPTURLPATH{"oops"}%/%WEB%/%TOPIC%?template=backlinksallwebs" title="%MAKETEXT{"Search all webs for topics that link to here"}%" accesskey="l">%MAKETEXT{"Find topics that link to [_1] ..." args="<nop>%TOPIC%"}%</a></b>,
--- 32,49 ----
       %MAKETEXT{"scans links in _[_1] web_ only" args="%WEB%"}%
  %TMPL:END%
  
! %TMPL:DEF{"copytopic"}%---+++ %MAKETEXT{"Copy topic"}%
! <form action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%WEB%">
!    * Select new =Web.TopicName= <br />
!         <select name="web">%WEBLIST{ "        <option $marker>$name</option>"}%
!         </select>.<input type="text" name="topic" value="%TOPIC%Copy" size="36">
!         <input type="hidden" name="templatetopic" value="%TOPIC%">
!         <input type="hidden" name="onlynewtopic" value="on">
!    * then
!         <input type="submit" class='twikiButton' value="Edit"> and save the new topic<br />
!         __Note:__ Topic text excluding attachments is cloned
! </form>
! %TMPL:END%
  
  %TMPL:DEF{"backlinks"}%---+++ %MAKETEXT{"Backlinks"}%
     * <b><a href="%SCRIPTURLPATH{"oops"}%/%WEB%/%TOPIC%?template=backlinksallwebs" title="%MAKETEXT{"Search all webs for topics that link to here"}%" accesskey="l">%MAKETEXT{"Find topics that link to [_1] ..." args="<nop>%TOPIC%"}%</a></b>,
***************
*** 120,125 ****
--- 131,137 ----
  %TMPL:P{"revision"}%
  %TMPL:P{"settings"}%
  %TMPL:P{"delete"}%
+ %TMPL:P{"copytopic"}%
  %TMPL:P{"rename"}%
  %TMPL:P{"setparent"}%
  %TMPL:P{"childtopics"}%

Future versions

  • Default to include attachments
  • Have a switch to turn off attachments
  • Have a checkbox to empty tables


Discussion

This is rather cool feature - for free. And adding it will not hurt UI and will be intuitive. Can it be added into CairoRelease?

-- PeterMasiar - 04 Apr 2003

Cool? That's great. Saves a lot of time. Only, one has to take care to copy to an existing topic!

-- AxelWagner - 04 Apr 2003

This is a small and useful feature.

-- PeterThoeny - 06 Mar 2005

Do the work against DevelopBranch; make a case for including it. Personally I'm not convinced; it needs a stronger case than is presented above, IMHO. TWiki has too many "nice little features" already.

-- CrawfordCurrie - 31 May 2005

Done against 4.2.0; If there are no objections I'll check it in.

This should be a standard feature because:
  • To take a copy is a very common operation
  • Imitation is how humans learn things
  • File Explorer provide copy
  • Wikis replace file shares
  • We have a lot of similar topics and, thus, have to do a lot of cut & paste.
  • Other wikis have this, users think of it as a fundamental usability feature
  • Before getting a tech to establish a Template Topic, users need natural operations
  • Most Template start as a copy (clone) of an existing topic

-- MartinCleaver - 30 Apr 2008

Agreed, this should be in the core. Please update the spec on top with the one you implement. I consider this a no-brainer, e.g. 2 week rule does not apply, but let the release manager decide.

-- PeterThoeny - 01 May 2008

UI is never a no brainer.

No new features should hit 4.2.1. Only bug fixes. Even the smallest enhancements adds risk of introducing a bug. New features are for 5.0 so I see no reason not to give the community the two weeks to consider the proposal when we know 5.0 is maybe as much as a year out in the horizon.

I personally whole hearted support this feature in 5.0 as long as it is implemented on the "more topic actions" page.

There can be some additional things to consider. What happens if you clone a topic with an ALLOWTOPICCHANGE that does not give YOU access. You end up with a clone that you cannot edit. Do we do anything about this? Also ensure that you cannot cheat the access rights system and open a more screen of a topic you otherwise do not have read access to. Also make sure you cannot clone a topic to a page in a web you do not have write access to.

-- KennethLavrsen - 01 May 2008

Hi, thanks for the considerations. I agree it can wait two weeks. Do you think it will be be a year until this feature makes it?

-- MartinCleaver - 02 May 2008

as long as it is implemented on the "more topic actions" page.

The "more" screen is pure UI horror. Just adding more options to it doesn't make it better...

sorry for the lack of a better (and releaseable) idea atm...

-- CarloSchulz - 05 May 2008

In my mind, the functionality belongs there.

The screen needs a UI revamp, for sure. Howabout a grid layout with icons and grouping?

-- MartinCleaver - 05 May 2008

For that matter, Create topic allows you to pick a template topic. But, in some cases the user wants to pick ANY topic as the base. I've documented this on NewTopicTemplate.

-- MartinCleaver - 05 May 2008

We have passed the 14-day mark a long time ago and I do not see any concerns that makes this proposal need a release meeting decision.

It is accepted by 14-day rule. The target release will be TWiki 5.0 which currently is the trunk in SVN.

-- KennethLavrsen - 29 May 2008

Completed.

http://foswiki.org/Tasks/Item1873

-- MartinCleaver - 19 Nov 2008
 
Topic revision: r3 - 06 Dec 2010, GeorgeClark
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