cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
This question about Using an extension: Answered

Change ClassifiedTopicViewTemplate

Hi!

I use classification plugin. How can I change the ClassifiedTopicViewTemplate ? - I want to show the content of a addtional data-field (that I added in the ClassifiedTopic Form)

TopicTitle.jpg

-- TomHorst - 01 Apr 2015

Do not modify the ClassifiedTopic form as that's going to break whenever the ClassificationPlugin is updated.

Instead create a new TopicType and copy&paste from ClassifiedTopic into the new one. Then customize the new TopicType as required.

In more detail:

1. Create a new TopicType

MyCustomTopic

| *Name:*| *Type:* | *Size:* | *Values:* | *Description:* | *Attributes:* | *Default:* |
| TopicType | label | 1 | MyCustomTopic, ClassifiedTopic, CategorizedTopic, TaggedTopic, WikiTopic | topic type  |  | |
| <nop>TopicTitle | text | 75 | | enter a title for this topic |  | |
| Summary | text | 75 | | short description or tagline | c | |
| Tag | tag | 30 | | keywords for this topic | c | |
| Category | cat | 1 |  | categories this topic is field to |  | |
| Text1 | text | 75 | | | |
| Text2 | text | 75 | | | |
| Text3 | text | 75 | | | |

2. Create a view template

... at TopicView

MyCustomTopicViewTemplate

%TMPL:INCLUDE{"Applications.ClassificationApp.ClassifiedTopicView"}%

%TMPL:DEF{"beforetext"}%%TMPL:PREV%
%RENDERFORDISPLAY{
   exclude="\b(TopicType|TopicTitle|Summary|Category|Tag)\b"
}%
%TMPL:END%

3. Create am edit template

... at TopicView

%TMPL:INCLUDE{"Applications.ClassificationApp.ClassifiedTopicEdit"}%

%TMPL:DEF{"formdefinition"}%Applications.ClassificationApp.MyCustomTopic%TMPL:END%

%TMPL:DEF{"topictype"}%my custom topic%TMPL:END%

Optionally add another tab to the editor by adding

%TMPL:DEF{"formfields"}%%TMPL:PREV%
%TMPL:P{"detailstab"}%
%TMPL:END%

%TMPL:DEF{"detailstab"}%%TAB{"Details"}%
%RENDERFOREDIT{
   exclude="\b(TopicType|TopicTitle|Summary|Category|Tag)\b"
}%
%ENDTAB%%TMPL:END%

-- MichaelDaum - 01 Apr 2015
 

QuestionForm edit

Subject Using an extension
Extension ClassificationPlugin, WikiWorkbenchContrib
Version Foswiki 1.1.9
Status Answered
Related Topics
Topic attachments
I Attachment Action Size Date Who Comment
TopicTitle.jpgjpg TopicTitle.jpg manage 3 K 01 Apr 2015 - 09:43 TomHorst  
Topic revision: r2 - 01 Apr 2015, MichaelDaum - This page was cached on 18 Jul 2018 - 11:02.

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