Sunday, June 24, 2007

[twiki] How to Install MultiEditPlugin

Tested installation of MultiEditPlugin and it's very cool (live example). Instead of putting the entire document into edit window, and having to scroll and look for that section you want to edit, you can now just edit specific sections. Notes from my install.

Before You Start
You need to have (or have someone who does) access to create files and change file access permission on the twiki file server (i.e. telnet or ftp into the actual machine)

Also, there is another plugin called SectionalEditPlugin that has very powerful feature that automatically enables the entire document for section editing. However, I haven't figured out how to customize it so the "edit" link float right properly in each section. Likely project for next weekend to customize the perl module. If I can get that done, I will likely use that plugin more often for basic editing use. MultiEdit however, gives you the ability to mark any part of the page as a section, which gives me more flexibility when I need it.

Copy EditContrib Plugin Files
- Download
- Copy files from the zip file to the locations of your twiki directory, according to this installation instruction.

Copy MultiEditContrib Plugin Files
- Download
- Copy files from the zip file to the locations of your twiki directory, according to this installation instruction.
- Bluehost specific instruction: Bluehost requires the bin files to be renamed with .pl extensions. So do that. And then, go to lib/TWiki/Plugins/ and search in the code to replace editonesection with

Verify Execute Permission on Files
- For the files you copied over to the bin sub-directory, you'll need to make sure that that they have the execute permissions. If you are on some flavor of unix, cd into the bin subdir and do chmod a+x addsection savesection editonesection

Enable the Plugins and Authentication
- Go to the configure program and enable the plugin. Exactly how you access the configure program may vary, generally speaking you are looking for http://[yoursite]/[yourtwikipath]/bin/configure, and then expand the "Plugins" section, then check the box next to {Plugins}{MultiEditPlugin}{Enabled}
- Alternatively, bring up lib/LocalSite.cfg and add in the line $TWiki::cfg{Plugins}{MultiEditPlugin}{Enabled} = 1;
- Also, under "Security Setup" section, {AuthScripts} attribute, add "editonesection" to the end of the comma delimited list. This tells TWiki to authenticate the users before editing the section.

Customize the Style
- By default, the edit link appears on the lower right of the section on it's own line. Personally, I prefer the wikipedia style of floating the edit link on the top right corner of the section. To do that:
- Go to http://[yoursite]/[yourtwikipath]/view/TWiki/MultiEditPlugin. Click "Edit" to modify the page, and replace Set PLACEMENT = after with Set PLACEMENT = before
- Add .multiEditLabel {float:right;} to your site's override stylesheet, if you have one already set up. Or if you don't already have one and you just want the shortcut, add to the stylesheet of the skin that you are using. For example, pub/TWiki/PatternSkin/style.css

You can now enclose sections that you'd like to edit individually with <section> and </section>.