Customizing edit toolbar

You can customize the Edit Toolbar quite easily.

In the ...wiki/includes/ directory you will find a file called EditPage.php

towards the bottom of this file you will find a number of lines like this:

array('image'=>'button_bold.png','open'=>"\'\'\'",'close'=>"\'\'\'",'sample'=>wfMsg('bold_sample'),'tip'=>wfMsg('bold_tip'),'key'=>'B'),

It is easy to work out from the names of the button image files which array is related to which function and you can delete buttons from the Edit Toolbar by simply removing the appropriate array lines.

You can change the image used by the buttons by changing the button_NNNN.png files - stored in the .../wiki/skins/common/images/ directory.

You can add buttons to the array by simply adding a new array definition - one reason to do this is to help users structure pages by adding a pre-defined set of headers, rules or advice.

For example to add a button that makes the selected text yellow and reduces it's size:


 * 1) make a button for your edit function (the standard size is 23 x 22 pixels)
 * 2) save it in the .../common/images file
 * 3) open ...wiki/includes/
 * 4) rename EditPage.php to EditPage_original.php
 * 5) open it up and add the new button to the array by inserting:

array('image'=>'button_smaller_yellow.png', 'open' => ', 'close' => ' ,'sample'=>wfMsg('smallred_sample'),'tip'=>wfMsg('smallyellow_tip'),'key'=>'R'),


 * 6) save as EditPage.php


 * 7) open a browser and make a new page in your wiki and check that the new button is working.

Tips

 * Add your own text inside the array using the Wiki Mark Up: ==Headline1==\\n\\n==Headline2== (\\n is a line break, \\n\\n is adds a blank line)
 * Remember not to use apostrophies
 * use  if you don't want text to show up on the final wiki page.
 * You need to add a special page so you can edit the wfMsg text - otherwise the tip text file name appears inside angled brackets when your pointer rolls over the button.