Blog

How I Installed AddThis in MediaWiki

As part of a side project, I’ve been playing around with the ever-popular wiki software MediaWiki. It’s the software that’s used to power Wikipedia.

After I got MediaWiki installed, I wanted to figure out how to install AddThis on all of my pages so they’d be shareable. Here’s how I did it…

Obviously, first I created an AddThis account. From there, I clicked on the “Get Your Button Code” button in the upper right-hand part of the page. I created a sharing/bookmarking button for a website and got my AddThis button code.

Next, I found the appropriate file for my MediaWiki skin. If you’re still using the default skin, it’d be skins > MonoBook.php. Open the file in your favorite coding application.

The file will show all the PHP that marks the beginnings of the HTML page.

I wanted to put the AddThis button right after the page’s title. If you’d like to do that, find this code <h1 class=”firstHeading”… After that line, paste the AddThis button code.

Finally, I published that file and I was set to go.

Let me know if you find these instructions useful. Drop me an e-mail – justin@addthis.com

  • Philip Wai

    I suggest adding the button inside the MediaWiki Toolbox in the left SideBar.

    To do so, look for these codes in the Monobookphp:

    wfRunHooks( ‘SkinTemplateToolboxEnd’, array( &$this ) );
    ?>

    Then add your button code right after the .

  • Philip Wai

    Oops, I cannot post HTML codes in this comment…

    So just look for

    wfRunHooks( ‘SkinTemplateToolboxEnd’, array( &$this ) );

    Then add your button code right after the “/ul” mark in the following line.

  • Thanks for your article on “How I Installed AddThis in MediaWiki”.

    I followed your instructions and successfully installed AddThis on my educational wiki and the home page called “Education Paragon”. You can see the App to the right of “From David Spencer’s Education Paragon: Helping students develop citizenship, literacy, responsibility and vision.”

    http://education.davidspencer.ca

    Thanks!

    David Spencer

  • Thanks for that useful information!
    I added my addthis-buttons to the toolbox AND on each page after the main heading :)

    check out my wiki: http://www.secret-wiki.de

    Cheers,
    Stefahn

  • Great posting…keep up the great work!