This question about Not sure...: Answered
How can I copy a topic into a new one, but replace the used DataForm?
I have extracted the "Copy topic" function from the "More"-page. It automatically makes a copy from a page, but this also copies the used form, probably because it's visible in the META-field and part of the topic.
There IS a code in there which copies the contents from a file, i.e.
<input type="hidden" name="templatetopic" value="%WEB%.%TOPIC%" />
So it would be great to have something like this:
<input type="hidden" name="templateform" value="%WEB%.MyForm" />
Is that possible?
- 02 Jul 2015
You are correct that if you use the standard "copy topic" function, it will automatically copy the topic's form as well as the content. However, along the lines of what you describe, you could define your own html form using two hidden inputs for
If you wanted to have this as the default action for the
More > Copy topic
feature, you'd need to modify or over-ride the
template definition in the
file. It's generally not a good practice to modify a distributed file because your changes would be over-written and lost the next time you update your installation or skins. You can avoid this by defining your own skin and just over-ride the particular elements you want to customize. To do this, start by making a copy of the
. You could remove everything in the copied file except the section that starts with
. You'll also want to add
to the first line of your file. This will pull in all template elements you don't define from the default "more" template. Then set you skin preference (in
. Once this is complete, your customized version of the
form will load rather than the standard version. (This description assumes you're using the default PatternSkin
implements topic-copying in a fairly different manner which includes the option to not
inlcude the dataform in the new topic.)
This little example shows how easy it is to override only select skin template elements from one of distributed skins with your own customized versions — which is one of the great features of Foswiki, imho.
Hope this helps.
- 17 Jul 2015