Forums | Mahara Community

Pedagogy /
Pinterest in Mahara

Anna Greenhill's profile picture
Posts: 29

14 September 2016, 4:09


Can you embed Pinterest boards into a Mahara page? I have tried embedding the link and embed code using the external media option but no joy! 

Any help would be gratefully received. 


Newman University, Birmingham. 

Kristina Hoeppner's profile picture
Posts: 4726

14 September 2016, 17:00

Hello Anna,

Pinterest doesn't provide a normal embed code like many other services. It looks very different and also requires that a script is added to the body of a page. The script would call the pin and include in the page as you only specify the URL for the pin but nothing else like usually. I couldn't get it to work with Embedly either because Pinterest revoked access to its API: I suspect that this might also prevent us from creating a custom filter for Pinterest. When I try creating an Embedly Card, it doesn't show the pin but still only the link to the Pinterest pin.




For reference, the embed code looks like the following for a pin:

Copy and paste this code into your page where you want your add-on to appear:
<a data-pin-do="embedPin" href=""></a>
Don't forget to include pinit.js once per page, right before the closing </BODY> tag.
<script async defer src="//"></script>
Aaron Wells's profile picture
Posts: 896

15 September 2016, 11:21

To expand on what Kristina said, here's the link to Pinterest's own documentation about embedding Pinterest boards:

It won't work with Mahara's "external media" block because it uses an <a> tag, not an <iframe>. But you could put that <a> link into a Text or Note block.

It also requires a Javascript file to be loaded on the page. Pasting the <script> tag into a Text or Note will not work, because Mahara strips out all Javascript from text entered by users, for security reasons. However, you might be able to get that to work by putting the necessary <script> tag into "$cfg->additionalhtmlfooter" in your site's config.php file. (See htdocs/lib/config-defaults.php for documentation of the $cfg->additionalhtmlfooter option.) That will cause it to be loaded on every page in your site.



3 results