Tags:
create new tag
view all tags

Question

I want to create a new topic (?) on the Wiki Word using a wysiwyg editor. I tried Set EDIT_SKIN = kupu in the TWikiPreferences but it's not working.

I could change the edit button to start wysiwyg editor but couldn't use the same editor when creating new topic, it always defaults to basic editor

Environment

TWiki version: TWikiRelease04x00x00
TWiki plugins: Wysiwg and pattern skins
Server OS: linux
Web server: apache
Perl version: 5.7
Client OS: XP
Web Browser: Mozilla
Categories: Installation

-- DuttKalapatapu - 26 Feb 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

I would also like to change the default editor to kupu, and to default to kupu when a new topic is created. Two of my wiki users have already complained about the fact that it defaults to the basic editor when they click on the question mark/link to create a new wiki topic. Also, I've seen several postings that adding EDIT_SKIN = kupu does not work. If there is not currently any way to do this, is anyone developing a work around?

-- TWikiGuest - 20 Mar 2006

OK, I figured something out that appears to work well, although it's a hack and not thoroughly tested. In lib/TWiki/Render.pm, in sub _renderNonExistingWikiWord, add skin=>'kupu' like so:

if (ref $theTopic && ref $theTopic eq 'ARRAY') {
        my $num = 1;
        my @posse = ();
        foreach my $t(@{ $theTopic }) {
            next if ! $t;
            push( @posse,
                  CGI::a(
                      { href => $this->{session}->getScriptUrl(
                          0, 'edit', $theWeb, $t,
                          topicparent => $this->{session}->{webName}.'.'.
                            $this->{session}->{topicName},
                            skin=>'kupu' ),
                        rel => 'nofollow',
                        title => ($this->{session}->{i18n}->maketext('Create this topic'))
                    },
                    $this->{NEWLINKSYMBOL} x $num ));
            $num++;
        }
        $ans .= join( ' ', @posse );
    } else {
        $ans .= CGI::a( { href=>$this->{session}->getScriptUrl(
            0, 'edit', $theWeb, $theTopic,
            topicparent => $this->{session}->{webName}.'.'.
              $this->{session}->{topicName},
            skin=>'kupu' ),
                          rel=>'nofollow',
                          title=>($this->{session}->{i18n}->maketext('Create this topic'))
                    },
                    $this->{NEWLINKSYMBOL} );
    }

After adding this, the user will get the kupu editor when clicking on the question mark to create the new topic. If anyone can see any problems with this approach, please let us know. I appreciate your feedback.

-- TWikiGuest - 22 Mar 2006

I most certainly can see a problem with this approach; but in the limited domain of your installation, it's OK. Just be aware that your hack will disappear when you next upgrade TWiki.

In general it's much much, much better to do this kind of customisation in templates rather than in code.

-- CrawfordCurrie - 11 Apr 2006

EDIT_SKIN does not exist in the WysiwygPlugin code tree anywhere. I checked.

-- MartinCleaver - 18 Apr 2006

To this note, for creating "new" topics that aren't already listed as WikiWords, you can modify data/TWiki/WebTopicCreator.txt

# diff  WebTopicCreator.txt.old WebTopicCreator.txt  -u
--- WebTopicCreator.txt.old     2006-08-18 14:56:21.000000000 -0500
+++ WebTopicCreator.txt 2006-08-18 14:56:57.000000000 -0500
@@ -101,6 +101,7 @@
 </div><!--/twikiFormSteps-->
 %STARTSECTION{"formend"}%<input type="hidden" name="onlywikiname" />
 <input type="hidden" name="onlynewtopic" value="on" />
+<input type="hidden" name="cover" value="kupu" />
 </form>
 <script type="text/javascript">
 //<![CDATA[

-- MarioLimonciello - 18 Aug 2006

Can you add support for this feature into twiki configure or preferences? I would prefer not to use such hacks. Thanks. Leos

-- LeosLiterak - 24 Sep 2006

Mario, we tried your approach with hidden form input without success. Is it sufficient to edit this file only? Or do we need to "refresh" twiki somehow (restart)?

-- LeosLiterak - 26 Sep 2006

Marios approach works quite well on my TWiki-Site. No refreshs, no server restarts necessary. Just edit/save the topic.

Here's my code (I've implemented a few more changes):

<form action='%SCRIPTURLPATH{"edit"}%/%WEB%/'>%BR%
<input type="hidden" name="topicparent" value="%TOPIC%" />
<input type="hidden" name="onlywikiname" value="off" />
<input type="hidden" name="cover" value="kupu" />
%ICON{"newtopic"}% Create new sub topic of %TOPIC% .<br /> Topic name:
<input class="twikiInputField" type="text" name="topic" size="32" />&nbsp;<input type="submit" class="twikiSubmit" value='create topic' /></form>

and this is the result:


New topic Create new sub topic of HowToCreateNewTopicUsingKupu .
Topic name:  

-- CarloSchulz - 07 Nov 2006

This is an unresolved question. Best to write a new SupplementalDocument in the TWiki web. See also related HowToCustomizeLinkLabels.

-- PeterThoeny - 17 Apr 2007

I was trying to create a new topic based on a template(using the MeetingMinutes Application) and would like to use WYSIWYG editor instead of default editor. Based on the discussion above, I tried Mario's approach. New topic creation uses WYSIWYG editor. However, the template is not getting used. If I use the default editor, the template creation uses the template. Here are the statements. Any thoughts?

<form name="new" action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%WEB%/">
%SEARCH{"^%TOPIC%20[0-9]+x" scope="topic" regex="on" nosearch="on" nosummary="on" nototal="on" reverse="on" format="   * $topic: $pattern(.*?\-\-\+\!\![^\n\r]*?Minutes[^\n\r]+?[\,\-]+([^\@\-\<\n\r]+).*) <font size=\"-2\" color=\"gray\"> - $wikiusername - [[%SCRIPTURL%/rdiff%SCRIPTSUFFIX%/%WEB%/$topic][$date]] - $rev</font>"}% 
   * <input type="text" name="topic" value="%TOPIC%2007x09x14" size="32" />
     <input type="hidden" name="topicparent" value="%TOPIC%" />
     <input type="hidden" name="onlynewtopic" value="on" />
     +<input type="hidden" name="cover" value="kupu" />
     <input type="submit" value="Create New Minutes" /><br />
     based on:
     <select name="templatetopic"><option>%TOPIC%Template</option>
     %SEARCH{"%TOPIC%20[0-9]+x" scope="topic" regex="on" nosearch="on" nosummary="on" nototal="on" reverse="on" limit="5" format="<option>$topic</option>" separator=" "}%
     </select>
     <font size="-1">
      * Change date if needed (date format =YYYYxMMxDD=); Optionally append meeting purpose after date.
      * Select template for new minutes (default is based on %TOPIC%Template)
</font>
</form>

-- BinurajRavindran - 14 Sep 2007

Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r14 - 2007-09-14 - BinurajRavindran
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.