preview.html.twig 1.1 KB

123456789101112131415161718192021222324
  1. {% extends 'partials/base.html.twig' %}
  2. {% set route = admin.route == '' ? '/' : '/' ~ admin.route %}
  3. {% set preview_link = base_url_relative_frontend|rtrim('/') ~ route %}
  4. {% set preview_html = (base_url|rtrim('/') ~ '/preview' ~ (context.home ? '' : context.route)) ?: '/' %}
  5. {% set admin_route = '/' ~ admin.route %}
  6. {% set back_link = base_url|rtrim('/') ~ '/pages' ~ page.find(admin_route).rawRoute() %}
  7. {% block titlebar %}
  8. <div class="button-bar">
  9. <a class="button" href="{{ back_link }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
  10. <a class="button" href="{{ preview_link }}" target="_blank"><i class="fa fa-external-link"></i> {{ "PLUGIN_ADMIN.OPEN_NEW_TAB"|tu }}</a>
  11. </div>
  12. <h1><i class="fa fa-fw fa-eye"></i> {{ "PLUGIN_ADMIN.PREVIEW"|tu }}: <strong>/{{ admin.route }}</strong></h1>
  13. {% endblock %}
  14. {% block content_wrapper %}
  15. <div class="content-wrapper preview-wrapper">
  16. <div class="content-padding" width="100%" height="100%">
  17. <iframe width="100%" height="100%" frameborder="0" src="{{ preview_link }}" />
  18. </div>
  19. </div>
  20. {% endblock %}