This question about Using an extension: Answered

Add chapter to topic from template

Hi,

I am creating an application in Foswiki and ran into the following problem.

I would like to have a button in the topic that adds content from a template. I did not have any problem creating a subtopic but I would like to add the template content to the end of the topic.

Any ideas? Thanks for your help.

-- MartenLucas - 21 Nov 2016

See the CommentPlugin. It can add data to topics at a defined place, at the end for example, including detailed templates if desired. Also check out CommentPluginExamples and CommentPluginTemplates

Note that Foswiki 1.0.6 is very old and no longer supported. You should check your local documentation on CommentPlugin as it has changed significantly.

-- GeorgeClark - 21 Nov 2016

Thank you GeorgeClark. We know that our Version is old but it has been customized and we are afraid to mess b/c the know-how is not available any more.

I had a look at the CommentPlugin but it does not seem to work. I used the following:

OK thank you for your help.
I think CopyContrib could also do the trick. If not I just put the content in a seperate topic and use TopicCreatePlugin. Anyway thanks alot.

-- Main.MartenLucas - 09 Dec 2016
%COMMENT{noform="on" type="bottom" templatetopic="ContentToBeAdded" target="%TOPIC%" button="Add specified content" }%
Hoping it would give me a button which if klicked would add the Content of the Topic ContentToBeAdded (Which exists) to the current Topic.

But there was an error message: No such template def TMPL:DEF{PROMPT:bottom}

FYI the ContentToBeAdded is an EditTable.

Any Idea? Thank you very much

-- MartenLucas - 06 Dec 2016

You'll need to check your own documentation on CommentPlugin and it's use of templates. Unfortunately I don't have any test Foswiki installations old enough to go back to 1.0.x to figure out your issues. Double-check the content of the CommentPlugin templates topic. The type="bottom" gets converted into the Template definition name: PROMPT:bottom. Ah.. The issue is that the "templatetopic" does NOT refer to a conventional topic, it's a special topic like CommentPluginTemplate. You need to copy System.CommentPluginTemplate to a new name and extend it with the information you want added to the target topic.

Note that the perl code used by Foswiki 1.0.x is no longer compatible with modern versions of the Perl language or recent CPAN modules. If for some reason you are forced to update your server, Foswiki will most likely not function. Even Foswiki 1.1 requires patches to support recent perl versions.

-- GeorgeClark - 07 Dec 2016

 

QuestionForm edit

Subject Using an extension
Extension TopicCreatePlugin
Version Foswiki 1.0.6
Status Answered
Related Topics
Topic revision: r5 - 09 Dec 2016, MartenLucas
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