linkedin badge

You have earned a badge and now want to post it on your profile on LinkedIn to show it off. Easy right?

Well, no. LinkedIn doesn’t have an easy API to posting external images or pages, but they do have a ‘add certification’ custom popup that you can include into a page that allows you to post the image – as long as the image is accessible to the general (un-authenticated) internet. That isn’t something Moodle lets you do – it makes the badge information page publically accessible but the badge itself is rendered at a tiny size (internally hard-coded too).

moodle is suposedly a modular environment that lets you extend and override a whole bunch of pages and areas using custom php or local plugins. except for the Badge page which is linked from the user profile page – it is effectively hard coded and isn’t part of the normal page render cycle. To change the Badge page you have to use a combination of two features:

  • custom scripts
  • overridden renderer in your theme

This is because a local plugin can’t override the renderer used by this page. So if you already have a custom theme, you have to modify it to patch in a renderer for the badge page and render the standard page plus your own modifications.

I’ve added a github repository which describes how to make the required changes and come sample code. unfortuantely I can’t supply a standalone plugin for just showing the button because of the way both linkedin and moodle have structured their systems.

Leave a comment