Forums | Mahara Community
Support
/
How to embed BibBase snippets
14 November 2013, 9:59
Hello,
I am exploring with embedding BibBase/Zotero pages/bibliographies. Would you know how to embed this code using TinyMCE on Mahara pages?
JavaScript (Easiest)
<script src="http://bibbase.org/show?bib=https%3A%2F%2Fapi.zotero.org%2Fgroups%2F150077%2Fitems%3Fkey%3DyqHi861yjEM6kWqD8yXy0hSD%26format%3Dbibtex%26limit%3D100&jsonp=1"></script>
PHP (Recommended)
<?php $contents = file_get_contents("http://bibbase.org/show?bib=https%3A%2F%2Fapi.zotero.org%2Fgroups%2F150077%2Fitems%3Fkey%3DyqHi861yjEM6kWqD8yXy0hSD%26format%3Dbibtex%26limit%3D100"); print_r($contents); ?>
iFrame
<iframe src="http://bibbase.org/show?bib=https%3A%2F%2Fapi.zotero.org%2Fgroups%2F150077%2Fitems%3Fkey%3DyqHi861yjEM6kWqD8yXy0hSD%26format%3Dbibtex%26limit%3D100"></iframe>
15 November 2013, 11:43
Hello Jonas,
This sort of code is stripped out of Mahara for security reasons. You can work with the iframe embed code the easiest. All you need to do is add the base URL to the list of "Allowed iframe sources". See http://manual.mahara.org/en/1.8/administration/extensions.html#allowed-iframe-sources for more info. I'd suggest to use
bibbase.org/show
as the base URL. You can then use the "External media" block on a page to copy and paste the iframe code or you can also use the iframe code elsewhere in Mahara in a text box or a journal entry.
If you prefer to use the JavaScript or PHP code, you would need to write a special filter so that the code is allowed.
Cheers
Kristina
25 April 2014, 23:52
Hi, long time...!
When allowing iframe sources: bibbase.org/
and inserting this snippet
<iframe src="http://bibbase.org/show?bib=https%3A%2F%2Fapi.zotero.org%2Fgroups%2F150077%2Fitems%3Fkey%3DyqHi861yjEM6kWqD8yXy0hSD%26format%3Dbibtex%26limit%3D100"></iframe>
we still do not get it to work. Any ideas?
BR / Jonas
15 May 2014, 1:00
Hi Jonas,
the example works fine for me, when I put it into an External Media block. From the first post I understand that you wanted to include the code in the tinyMCE editor. As far as I know, the tinyMCE editor doesn't respect the allowed iframe sources. So you can only use that code within an own External Media block.
Or was that what you tried and what didn't work?
Tobias
15 May 2014, 1:49
Thanks a lot Tobias! Now I replied to Dajan (and also answered your question re the block I used) here: https://mahara.org/interaction/forum/topic.php?id=6315&offset=0&limit=10#post26710
Perhaps we can continue in that forum instead?
Thanks so very much for your guidance! / Jonas
A post by Account deleted was deleted