Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permettre d’inclure les pages dans un autre site #194

Open
3 tasks
Ash-Crow opened this issue Jul 17, 2024 · 0 comments
Open
3 tasks

Permettre d’inclure les pages dans un autre site #194

Ash-Crow opened this issue Jul 17, 2024 · 0 comments
Assignees
Labels
amélioration Nouvelle fonctionalité ou demande

Comments

@Ash-Crow
Copy link
Collaborator

Certains utilisateurs voudraient pouvoir intégrer le site dans d’autres via iframe, par exemple via ?embed=1 à la fin des URLs

  • Il faut retirer les en-têtes HTML qui empêchent cela
  • Côté code, il suffit de modifier le fichier base.html comme suit :
{# ... #}
  <body>
    {% if not request.GET.embed %}
      {% block skiplinks %}
        {% dsfr_skiplinks skiplinks %}
      {% endblock skiplinks %}

      {% include "blocks/header.html" %}
      {% dsfr_theme_modale %}
      {% wagtailuserbar %}

      {% if settings.content_manager.CmsDsfrConfig.notice %}
        {% dsfr_notice title=settings.content_manager.CmsDsfrConfig.notice %}
      {% endif %}
    {% endif %}

    <main id="content" role="main">
      {% block content %}
      {% endblock content %}
    </main>

    {% block follow_newsletter_social_media %}
      {% if settings.content_manager.CmsDsfrConfig.show_newsletter_and_social_block %}
        {% include "blocks/follow.html" %}
      {% endif %}
    {% endblock follow_newsletter_social_media %}

    {% if not request.GET.embed %}
      {% include "blocks/footer.html" %}
    {% endif %}

    {% dsfr_js nonce=request.csp_nonce %}
    {% block extra_js %}
    {% endblock extra_js %}

    {% block body_tracking_scripts %}
      {% if settings.content_manager.AnalyticsSettings.body_scripts %}
        {{ settings.content_manager.AnalyticsSettings.body_scripts|safe }}
      {% endif %}
    {% endblock body_tracking_scripts %}
  </body>
</html>
  • Il faudrait peut-être modifier le fil d’Ariane également ?
@Ash-Crow Ash-Crow self-assigned this Jul 22, 2024
@Ash-Crow Ash-Crow added the amélioration Nouvelle fonctionalité ou demande label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amélioration Nouvelle fonctionalité ou demande
Projects
None yet
Development

No branches or pull requests

1 participant