Suggestion : H5p support


Here is a suggestion for Zenphoto : H5P support.

Lumi under Linux enables creation of great interactive photo/video presentations on my computer.
I can import H5p files under Moodle, also on my website as experimental CMS, and then generate an iframe that can be displayed in a Zenphoto codeblock.

Native Zenphoto H5P support would be much easier.

Bien cordialement.


  • acrylian Administrator, Developer

    I am sorry, never hread of it and it seems to be a very niche format and not a web format anyway. Sorry.

    If it needs an iframe you could create workarounds for this using the text-object plugin if FTP is fine for you. Upload your files and create text files with the iframe referencing it.

    Or with some theme customizing try perhaps the anyfile plugin. Use the latter to allow the file suffix of those files so you can upload them via backend. Anyfile will only display the sidecar file but you can add a switch to load the actual file in an iframe on your theme.

  • ctdlg Member
    edited June 14

    Thank you,
    I will use Moodle and the Zenphoto codeblock option.
    It does work this way.
    H5p is used by almost all teachers in France to produce various quizzes or multimedia presentations.
    I'm not a teacher, and discovered H5p recently.
    Someone else (a teacher) showed me all possibilities.
    I's easy and gives funny/outstanding results.

  • acrylian Administrator, Developer

    I do know Moodle roughly from some years ago but not heard of H5p. You hopefully undersand that we really have no resources for such rather niche request sadly.

    Using a codeblock is certainly a way, too. A way would to create a plugin with a content macro to include an iframe for any external content directly into text content. Actually you could already creatively "miss use" use my side plugin zp_mapembed and its OpenStreetMap content macro (not related to our OSM plugin). It basically does just that.

  • ctdlg Member
    edited June 14

    I already use Openstreetmap on my Zenphoto website.

    Look at this link that does work under Zenphoto :
    you can mix sounds, texts photos, panos, vidéos, webpages ... on one page.

    Perfect to produce a demo to show what your zenphoto site offers,!
    or to create dynamic pages using your best pictures/movies/sounds...

    No need of Lumi, I can prepare my demo on my website, using Moodle CMS, publish it on same Zenphoto website.

    It acts like an embedded powerpoint file.

    My Moodle part is admin protected: no visitor can create an account or access any page, but it decodes H5p files under Zenphoto without Moodle user account.

    It is so easy that it is not necessary to create a Zenphoto plugin.

    I now know the H5p Zenphoto workflow.
    I now will read the complete H5p manual to be able to produce really good dynamic pages for Zenphoto.

    Probably this message will be useful for some of you.

  • acrylian Administrator, Developer

    I already use Openstreetmap on my Zenphoto website.

    As I mentioned the plugin I was referencing is not the OpenStreetMap plugin. You said you use an iframe which is what that other plugin can provide already.

  • ctdlg Member

    Your zp_mapembed plugin helped me : my plugin is now working.
    My Moodle H5p iframes are now embedded using [ mymacro %parameter ] - code modified in admin edit page.

    I would like to change ALL codeblocks recursively
    but nothing changes using str_replace :

    <?php while (next_image()) :                        
                    $newHtmlContent = str_replace($search, $replace, $cb);
     endwhile; ?>

    Note : I cannot view all my code in the above < pre > < code > block

    $cb and $newHtmlContent are the same.

    Using another var $test = full codeblock from the editor,
    $newHtmlContent = str_replace($search, $replace, $test);
    does work.

    Is html_encode(getCodeblock(1)) using special encoding ?

    I cannot search the database (phpmyadmin) for " script " or other codes like " iframe " ( with < >) used in my codeblocks : I get empty results.

    I cann edit manually an sql backup but cannot find whole codeblocks contents.

    Searching the web does not help me.
    Even Chatgpt gives me php code that does not work with Zenphoto codeblocks.
    This is because I am not a developer and do not understand everything.

  • acrylian Administrator, Developer
    edited June 24

    Remove the html_encode() to get the plain value of the codeblock. That is for escaping html on outputting/echoing, not for working with plain values.

    You change will not be a permanent change but an on the fly one. To do that you would have to use the object model which might be a little to advanced.

    If you have more than one codeblock they all share the same db column using array serialization. That makes it a litte hard to search directly.

  • ctdlg Member

    I can use the Firefox "Foxreplace" extension.
    It finds all I want to remove, replace it with my macro code.
    This is a manual solution, a bit faster than doing all changes myself.
    I will use it.
    Thank you for your help.

  • acrylian Administrator, Developer

    Not sure how a browser extension (I don't know that) will help you here. It will not change the values in the database columns where your old iframe code is stored.

    You have to get the value, change it with the macro and then save the update. Unless you want to do this on the fly on display every time.

  • ctdlg Member

    You are right, I mentioned "a manual solution".
    I edit an image, use Foxreplace that searches and replacesthe text I want to change in the codeblock, submit, view the result, edit next image and so on.

  • acrylian Administrator, Developer

    Ok, now I understand. Quite some work if you have a lot of codeblocks to update.

Sign In or Register to comment.