Database activity - strips iframes?

Database activity - strips iframes?

by Paul Vincent -
Number of replies: 5

We've just begun to use the Database activity as a central resource space, but have found that it's stripping/blocking iframes e.g. any videos or h5p content. We're able to embed iframes elsewhere, e.g. Forums, Pages, Labels etc. but using the same process in a Database activity results in nothing being displayed. Filters are also set the same for database as for other activities etc.

Is there a setting specific to Database Activities somewhere that causes this?

Many thanks

Paul

Average of ratings: -
In reply to Paul Vincent

Re: Database activity - strips iframes?

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
When editing your templates and you want to embed that kind of stuff, you might get it to work if you Disable the editor and edit using plain text. YMMV but it has worked in the past for me when working on database activities. For example, if you install the Database Time Tracker preset, and then edit the templates with the editor enabled, it will break the preset.
In reply to AL Rachels

Re: Database activity - strips iframes?

by Paul Vincent -
Ah, I just realised you're referring to embedding into the templates? I was hoping you meant there was a way to disable th editor for some field types.

The iFrame issue I have is that iframes get stripped out when adding them as an entry via the code/html view of a text area field. The Multimedia filter works, however, so I can add a link to a Vimeo video and that will then display, but H5P links don't seem to work despite that filter being enabled. iFrames seem to be working everywhere else in activities and resources; it's just Database activities this seems to be occuring for.
In reply to Paul Vincent

Re: Database activity - strips iframes?

by Gillian Delvigne -
I would like to relaunch this topic.
It seems that it is not possible to integrate an iframe tag in a database entry. I made multiple tests with Youtube, H5P and Genially. Systematically, the tag was removed from the entry.
Is there a workaround to allow this type of content to be displayed?
(Youtube works with a simple link due to multimedia filter, but what about the rest?)

Thank you very much!

EDIT
I found the reason in the doc :

For security reasons, moodle just does not allow you to use iframes everywhere. In general, iframe code is not allowed in Moodle activities to which all class members can contribute, including Assignment submissions, Wiki, Forum, Database, Glossary, and Blog activities. In these activities iframe-embedded video displays in the HTML editor, but will be stripped out when posts or submissions are saved.
In reply to Gillian Delvigne

Re: Database activity - strips iframes?

by John Provasnik -
Picture of Particularly helpful Moodlers Picture of Testers
A filter worked in my case for Glossary - I use the H5P filter (where I just add the activity name and it renders the entire H5P upon saving). I use vidgrid for videos so I have the Oembed filter for vidgrid allowing me to just type the url as a link and the video displays as an iframe upon saving. Haven't tried in Database but may be worth a try.