grav/themes/quark-open-publishing/templates/h5p.html.twig

44 lines
1.5 KiB
Twig
Raw Normal View History

{# no tab indents for Page Inject Plugin compatibility - hibbittsdesign.org #}
{% if page.header.published %}
{% if page.header.display_page_title is defined and not (displaypagetitle is defined)%}
{% set displaypagetitle = page.header.display_page_title %}
{% endif %}
{% if page.header.display_h5p_content_title is defined and not (displaycontenttitle is defined)%}
{% set displaycontenttitle = page.header.display_h5p_content_title %}
{% endif %}
{% block content %}
<div class="h5p-content-wrapper">
<p>
{{ page.content|raw }}
{% if displaypagetitle is defined %}
{% if displaypagetitle %}
<strong>{{ page.title }}</strong><br>
{% endif %}
{% endif %}
{% if displaycontenttitle is defined %}
{% if displaycontenttitle %}
{{ page.header.h5p_content_title_title }}
{% endif %}
{% endif %}
{% set h5pcontentid = page.header.h5p_content_id %}
{% if h5pcontentid|contains('http') %}
{% set h5pcontenturl = h5pcontentid %}
{% else %}
{% if theme_var('h5pembedrootpath') %}
{% set h5pembedrootpath = theme_var('h5pembedrootpath') %}
{% else %}
{% set h5pembedrootpath = 'https://h5p.org/h5p/embed/' %}
{% endif %}
{% if h5pembedrootpath|contains('h5p.com') %}
{% set h5pcontenturl = h5pembedrootpath ~ h5pcontentid ~ '/embed' %}
{% else %}
{% set h5pcontenturl = h5pembedrootpath ~ h5pcontentid %}
{% endif %}
{% endif %}
<iframe src="{{ h5pcontenturl }}" width="400" height="300" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
<script src="https://h5p.org/sites/all/modules/h5p/library/js/h5p-resizer.js" charset="UTF-8"></script>
</p>
</div>
{% endblock %}
{% endif %}