Re adding the edit toolbar button, I've now added the code to the bottom of this page:
http://www.chainsofreason.org/wiki/MediaWiki:Common.js
but the extra button doesn't appear in the toolbar. Any ideas about what I've done wrong?!
Derrick
On Nov 15, 2007 9:59 PM, Derrick Farnell derrick.farnell@gmail.com wrote:
That's sounds very promising - I'll have a look at those extensions.
Thanks very much!
Derrick
On Nov 15, 2007 9:18 PM, Jim Hu <jimhu@tamu.edu > wrote:
It would insert {{Template:Boilerplate}}. But you should be able to use {{subst:Template:Boilerplate}}, which should replace the whole thing when saved. But it will still only insert {{subst:Template:Boilerplate}} in that edit session.
You may find it easier to have users create pages from a Boilerplate template and then edit them, instead of starting with a blank page and pasting in the Boilerplate. There are a number of extensions that can do this, e.g. Extension:Boilerplate if I recall correctly.
Jim
On Nov 15, 2007, at 2:14 PM, Derrick Farnell wrote:
Actually, it isn't the whole boilerplate that I'm wanting to make insertable via a toolbar button, just extra, optional, sections to the boilerplate. However, it would make things easier for the user if I made the boilerplate a template and then used the code below to allow users to insert it into a blank page via a button, instead of cutting and pasting the boilerplate over
- and then create another button for the extra sections.
I assume the method below would indeed insert the contents of the template, and not just '{{Template:Boilerplate}}'.
Derrick
On Nov 15, 2007 7:49 PM, Jim Hu jimhu@tamu.edu wrote:
You might also consider making the boilerplate a Template page instead of hardcoding it into the js. That way you can edit it in the wiki.
mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "url of the button image", "speedTip": "Custom text", "tagOpen": "", "tagClose": "", "sampleText": "{{TemplatePageName}}\n" + };
Jim H.
On Nov 15, 2007, at 12:52 PM, Jim Wilson wrote:
The chunk of wiki text is actually over several lines - is this solution only for inserting single lines?
If you want to insert multiple lines, your addition may look more like this:
mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "url of the button image", "speedTip": "Custom text", "tagOpen": "", "tagClose": "", "sampleText": "First line of template text\n" + "Second line of template text\n" + "Third and final line of template text." };
On Nov 15, 2007 12:08 PM, Derrick Farnell derrick.farnell@gmail.com wrote:
Thanks very much for your help. The chunk of wiki text is actually over several lines - is this solution only for inserting single lines?
Derrick
On Nov 15, 2007 4:18 PM, Jim Hu < jimhu@tamu.edu> wrote:
> It may be hard without any programming knowledge... > > The extra buttons at wikipedia are controlled by javascript in the
> page Mediawiki:Common.js. I've made this a bit easier to read on > our > wiki: > > http://ecoliwiki.net/colipedia/index.php/ > MediaWiki:Common.js#Extra_toolbar_options > > What you need to do is define another button handler for your > desired > text. > > mwCustomEditButtons[mwCustomEditButtons.length] = { > "imageFile": "url of the button image", > "speedTip": "Custom text", > "tagOpen": "", > "tagClose": "", > "sampleText": "insert custom text here"}; > > I think that will work. Haven't tried it, though. > > Jim > > > On Nov 15, 2007, at 7:46 AM, Derrick Farnell wrote: > >> Hi >> >> I'd like users of my wiki (www.chainsofreason.org ) to be able to >> add a >> particular chunk of wikitext to a page by simply clicking on a >> button in the >> edit page toolbar, but have been unable to find a suitable >> extension. Is >> there some relatively easy way to achieve this? I don't have any >> programming >> knowledge. >> >> Derrick >> Chains of Reason >> www.chainsofreason.org >> _______________________________________________ >> MediaWiki-l mailing list >> MediaWiki-l@lists.wikimedia.org >> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l > > ===================================== > Jim Hu > Associate Professor > Dept. of Biochemistry and Biophysics > 2128 TAMU > Texas A&M Univ. > College Station, TX 77843-2128 > 979-862-4054 > > > _______________________________________________ > MediaWiki-l mailing list > MediaWiki-l@lists.wikimedia.org > http://lists.wikimedia.org/mailman/listinfo/mediawiki-l > _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l