Quick & Dirty patch to make Raw edit the default

Some people upgrading big sites to 4.2 may want to minimize the risk and keep Raw edit as the default (acceskey 'e') behavior, and the new Wysiwyg editor a separated button, (accesskey 'w'). This has also the advantage of not changing the accesskeys relative to previous versions.


  1. download viewtopicactionbuttons.editdefault.tmpl attached to this topic to your templates/ directory
  2. in your Main/TWikiPreferences topic, put a:
    • Set SKIN = editdefault,pattern

Also attached for reference (you do not need to download it) is the diff between viewtopicactionbuttons.editdefault.tmpl and the original pattern file, viewtopicactionbuttons.tmpl.

-- Contributors: ColasNahaboo - 17 Jan 2008


I think that keeping Raw edit default is the best option. Thanks for patch

-- CarlinhosCecconi - 17 Jan 2008

Changed from a patch to pattern (dirty) to a variant of the pattern skin (cleaner, survives upgrades)

-- ColasNahaboo - 23 Jan 2008

After using the new template new topics still start editing in WYSIWYG editor. The nowysiwyg parameter can be included in the form defined n TWiki.WebCreateNewTopicTemplate to fully obtain the same behavior of previous TWiki version. In TWiki.WebCreateNewTopicTemplate replace this

%TMPL:DEF{"formstart"}%<form name="newtopicform" id="newtopicform" action="%SCRIPTURLPATH{edit}%/%BASEWEB%/">
<input type="hidden" name="onlynewtopic" value="on" /> %TMPL:END%

With this

%TMPL:DEF{"formstart"}%<form name="newtopicform" id="newtopicform" action="%SCRIPTURLPATH{edit}%/%BASEWEB%/">
<input type="hidden" name="onlynewtopic" value="on" /><input type="hidden" name="nowysiwyg" value="1" />%TMPL:END%

-- EnriqueCadalso - 21 Apr 2008

I have followed these instructions and it doesn't work the damn editor continues to override the raw editor. Given the wretched nature of TinyMCE - it litters the TWiki markup with bits of HTML, it adds no breaking spaces and will NOT let the user remove them - I do not want it as the default.

I've been forced to us TinyMCE with Joomla - and have often resorted to holding the HTML want to create in a local editor & pasting it into the html view 9which due to space removal is otherwise utterly useless).

It's fine, i suppose, for novices editing text. It is unsuitable if the user is setting preference variables, searches (again, adding or deleting spaces and returns when it thinks suitable, or leaving html embedded in the search parameters).

I would like to leave it available in the WYSIWYG edit button at the bottom of the screen, but I've been forced to disable it completely.

This patch only seems to work if the skin setting is in each topic - WHY?

-- ChrisHogan - 10 Jun 2008

My comments about the utility of TinyMCE still stand, byt it helps if I haven't overridden the SKIN settings in the WebPreferences - mea cupla

-- ChrisHogan - 10 Jun 2008

I have applied this fix and it seems to work, however...

Add a form to a topic & the raw edit is replaced by TinyMCE which then proceeds to append my anchors onto the end of the preceding lines

Irritating, but once I save it & edit again, raw edit is restored, so it's only immediately after adding a form to a topic.

-- ChrisHogan - 12 Jun 2008

I will report this as a bug - if the WysiwygPlugin? is enabled & action=form is set, then when creating a new topic the templatetopic (and therefore form) setting is not honoured. The new top is created without template or form

-- ChrisHogan - 20 Jun 2008

I managed to set my edit default to raw edit. But one thing that I realize is broken is when I want to attach a file by clicking "attach", I realize that there is no longer "upload file" or "cancel" button at the bottom of the attach page (attach/Main/TWikiPreferences)

When I changed back the setting from "Set SKIN = editdefault, pattern" to "Set SKIN = pattern", those "upload button" and "edit" buttons are back.

Is this happening to someone as well? or only me?

Thanks for your help.

-- RiniTanady - 28 Jul 2008

I found out the problem!!

-- RiniTanady - 29 Jul 2008

Those that just don't want the WysiwygPlugin features can disable it from configure, as the shipped skins will adapt and use 'Raw Edit' instead.

-- RafaelAlvarez - 29 Jul 2008

This does not completely work. For example, when creating a new topic, it puts you into the Wysywig mode (editing TWiki/WebCreateNewTopicTemplate does not seem to do the trick). There may be other such situations.

We need to be able to tell the user how to fully have a default that is not Wysiwyg.

Our users like the Wysiwyg editor to be around, but they want the default to be Raw. I think given the current shape of the editor, that is wise choice.

-- ThomasWeigert - 21 Aug 2008

To make RawEdit? as default when topic creates from target link like NewTopic? ? by click on question-mark follow up: Open page TWiki.TWikiPreferences for Edit. Replace this line:

         * Set NEWLINKFORMAT = <span class="twikiNewLink">$text<a href="%SCRIPTURLPATH{"edit"}%/$web/$topic?topicparent=%WEB%.%TOPIC%" rel="nofollow" title="%MAKETEXT{"Create this topic"}%">?</a></span> 
with this:
         * Set NEWLINKFORMAT = <span class="twikiNewLink">$text<a href="%SCRIPTURLPATH{"edit"}%/$web/$topic?topicparent=%WEB%.%TOPIC%;nowysiwyg=1" rel="nofollow" title="%MAKETEXT{"Create this topic"}%">?</a></span> 

-- VitalyKichenko - 05 Dec 2008

Some people? As of today, ad 14000 more people.

-- VickiBrown - 03 Apr 2009

Topic attachments
I Attachment History Action Size Date Who Comment
Texttxt DefaultEditRawDirtyPatch.txt r1 manage 2.1 K 2008-01-17 - 08:56 ColasNahaboo for reference only: diffs to templates/viewtopicactionbuttons.tmpl
Unknown file formattmpl viewtopicactionbuttons.editdefault.tmpl r1 manage 6.3 K 2008-01-23 - 07:12 ColasNahaboo to put in templates/ dir
Edit | Attach | Watch | Print version | History: r13 < r12 < r11 < r10 < r9 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r13 - 2009-04-03 - VickiBrown
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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.