Manual:Custom edit buttons

Since there is no effective extension to add the wikipedia edit toolbar extra buttons, this is the only way to create them in a particular wiki.

Here is how your edit page will look like after the changes.

This stuff was found out by me, The Pop-Cult Architect.

Step one: save the images
Go to wikipedia, choose an editable article, click the edit tab, right click the extra edit button(s) you want, save the image to the skins/common/images directory of the wiki in your server. Don't forget to save them as .png, that means, don't change its format.

Step two: modify EditPage.php
In the directory of your wiki, go to the subdirectory /includes/ and open in Kwrite (or whatever works) the EditPage.php file.

$toolarray = array(			array(	'image'	=> 'button_bold.png', 'id'	=> 'mw-editbutton-bold', 'open'	=> '\\\'\\\'\\\'', 'close'	=> '\\\'\\\'\\\'', 'sample'=> wfMsg('bold_sample'), 'tip'	=> wfMsg('bold_tip'), 'key'	=> 'B'			),			array(	'image'	=> 'button_italic.png', 'id'	=> 'mw-editbutton-italic', 'open'	=> '\\\'\\\'', 'close'	=> '\\\'\\\'', 'sample'=> wfMsg('italic_sample'), 'tip'	=> wfMsg('italic_tip'), 'key'	=> 'I'			),			array(	'image'	=> 'button_headline.png', 'id'	=> 'mw-editbutton-headline', 'open'	=> "\\n== ", 'close'	=> " ==\\n", 'sample'=> wfMsg('headline_sample'), 'tip'	=> wfMsg('headline_tip'), 'key'	=> 'H'			),			array(	'image'	=> 'button_small.png', 'id'	=> 'mw-editbutton-small', 'open'	=> ' ', 'close'	=> ' ', 'sample'=> wfMsg('small_sample'), 'tip'	=> wfMsg('small_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_upper_letter.png', 'id'	=> 'mw-editbutton-upper_letter', 'open'	=> ' ', 'close'	=> ' ', 'sample'=> wfMsg('upper_sample'), 'tip'	=> wfMsg('upper_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_lower_letter.png', 'id'	=> 'mw-editbutton-lower_letter', 'open'	=> ' ', 'close'	=> ' ', 'sample'=> wfMsg('lower_sample'), 'tip'	=> wfMsg('lower_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_strike.png', 'id'	=> 'mw-editbutton-strike', 'open'	=> ' ', 'close'	=> ' ', 'sample'=> wfMsg('strike_sample'), 'tip'	=> wfMsg('strike_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_hr.png', 'id'	=> 'mw-editbutton-hr', 'open'	=> "\\n\\n", 'close'	=> '', 'sample'=> '', 'tip'	=> wfMsg('hr_tip'), 'key'	=> 'R'			),			array(	'image'	=> 'button_enter.png', 'id'	=> 'mw-editbutton-enter', 'open'	=> ' ', 'close'	=> '', 'sample'=> '', 'tip'	=> wfMsg('enter_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_link.png', 'id'	=> 'mw-editbutton-link', 'open'	=> ,				'close'	=> , 'sample'=> wfMsg('link_sample'), 'tip'	=> wfMsg('link_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_media.png', 'id'	=> 'mw-editbutton-media', 'open'	=> .$wgContLang->getNsText(NS_MEDIA).':',				'close'	=> , 'sample'=> wfMsg('media_sample'), 'tip'	=> wfMsg('media_tip'), 'key'	=> 'M'			),			array(	'image'	=> 'button_extlink.png', 'id'	=> 'mw-editbutton-extlink', 'open'	=> '[', 'close'	=> ']', 'sample'=> wfMsg('extlink_sample'), 'tip'	=> wfMsg('extlink_tip'), 'key'	=> 'X'			),			array(	'image'	=> 'button_image.png', 'id'	=> 'mw-editbutton-image', 'open'	=> .$wgContLang->getNsText(NS_IMAGE).":",				'close'	=> , 'sample'=> wfMsg('image_sample'), 'tip'	=> wfMsg('image_tip'), 'key'	=> 'D'			),			array(	'image'	=> 'button_gallery.png', 'id'	=> 'mw-editbutton-gallery', 'open'	=> '\n\n', 'sample'=> wfMsg('gallery_sample'), 'tip'	=> wfMsg('gallery_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_hide_comment.png', 'id'	=> 'mw-editbutton-hide_comment', 'open'	=> '', 'sample'=> wfMsg('hide_sample'), 'tip'	=> wfMsg('hide_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_math.png', 'id'	=> 'mw-editbutton-math', 'open'	=> "", 'close'	=> "", 'sample'=> wfMsg('math_sample'), 'tip'	=> wfMsg('math_tip'), 'key'	=> 'C'			),			array(	'image'	=> 'button_nowiki.png', 'id'	=> 'mw-editbutton-nowiki', 'open'	=> " ", 'close'	=> "", 'sample'=> wfMsg('nowiki_sample'), 'tip'	=> wfMsg('nowiki_tip'), 'key'	=> 'N'			),			array(	'image'	=> 'button_blockquote.png', 'id'	=> 'mw-editbutton-blockquote', 'open'	=> ' \\\'\\\'', 'close'	=> '\\\'\\\' ', 'sample'=> wfMsg('blockquote_sample'), 'tip'	=> wfMsg('blockquote_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_insert_table.png', 'id'	=> 'mw-editbutton-insert_table', 'open'	=> '\n{| class="wikitable"\n|-\n', 'close'	=> '\n|}\n', 'sample'=> wfMsg('table_sample'), 'tip'	=> wfMsg('table_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_reflink.png', 'id'	=> 'mw-editbutton-reflink', 'open'	=> ' ', 'sample'=> wfMsg('reflink_sample'), 'tip'	=> wfMsg('reflink_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_redirect.png', 'id'	=> 'mw-editbutton-redirect', 'open'	=> '#REDIRECT ',				'close'	=> '', 'sample'=> wfMsg('red_sample'), 'tip'	=> wfMsg('red_tip'), 'key'	=> 'L'			),			array(	'image'	=> 'button_sig.png', 'id'	=> 'mw-editbutton-signature', 'open'	=> '--~', 'close'	=> '', 'sample'=> '', 'tip'	=> wfMsg('sig_tip'), 'key'	=> 'Y'			)		); $toolbar = " \n";
 * 1) Erase all the content from $toolarray = array( to $toolbar = " \n";
 * 2) Paste this:
 * Note:It is very important that the file names and textensions in the image fields are the same as the ones you copied to your /common/images/ directory, be careful with capitals and all.

Step three: modify EditPage.php
In the directory of your wiki, go to the subdirectory /languages/messages/ and open in Kwrite (or whatever works) the MessagesEn.php file (or whatever MessagesXx.php, according to your wiki's language. En is for English).


 * In the # Edit page toolbar "section", paste the following:

'red_tip'        => 'Redirect', 'strike_tip'     => 'Strike-through text', 'enter_tip'      => 'Insert a line break', 'upper_tip'      => 'Superscript text', 'lower_tip'      => 'Subscript text', 'small_tip'      => 'Small text', 'hide_tip'       => 'Insert hidden comment', 'gallery_tip'    => 'Insert a picture gallery', 'blockquote_tip' => 'Insert block of quoted text', 'table_tip'      => 'Insert a table', 'reflink_tip'    => 'Insert a footnote reference', 'red_sample'     => 'Redirect', 'strike_sample'  => 'Strike-through text', 'upper_sample'   => 'Superscript text', 'lower_sample'   => 'Subscript text', 'small_sample'   => 'Small text', 'hide_sample'    => 'Hidden text', 'gallery_sample' => 'Example', 'blockquote_sample'=> 'Quoted paragraph', 'table_sample'   => '! header 1 ! header 2 ! header 3 'reflink_sample' => 'Insert footnote text here',
 * row 1, cell 1
 * row 1, cell 2
 * row 1, cell 3
 * row 2, cell 1
 * row 2, cell 2
 * row 2, cell 3',
 * row 2, cell 2
 * row 2, cell 3',

Go further
Here are some examples of buttons I created myself following the same logic.

Go to my incredibly cool site, Pop-Cult Guides, (check it out, look around, edit or create some article, maybe open an account) choose any article, click the edit tab, right click the extra edit button(s) you want (in this case pre or template), save the image to the skins/common/images directory of the wiki in your server. Again, don't forget to save them as .png, that means, don't change its format.


 * Paste this in the /includes/EditPage.phpfile (please be careful, put it somewhere between other buttons, before the last making sure you don't break any button syntax).

array(	'image'	=> 'button_pre.png',				'id'	=> 'mw-editbutton-pre',				'open'	=> '\n \n',				'close'	=> '\n\n',				'sample'=> wfMsg('pre_sample'),				'tip'	=> wfMsg('pre_tip'),				'key'	=> 'L'			), array(	'image'	=> 'button_temp.png',				'id'	=> 'mw-editbutton-template',				'open'	=> '',				'sample'=> wfMsg('temp_sample'),				'tip'	=> wfMsg('temp_tip'),				'key'	=> 'L'			),
 * Right there, replace the * with the leter e, so that you have the command "  " (this weird step is because I cant write " " here, in this page, without breaking the "show sintax in the article" command).

'pre_sample'     => 'Code text syntax', 'temp_sample'    => 'Template', 'pre_tip'        => 'Present code text syntax', 'temp_tip'       => 'Hidden text',
 * In /languages/messages/MessagesEn.php the # Edit page toolbar'' "section", paste the following:

So, there: your wiki is already superior to Wikipedia... at least in buttons haha :P