wiki-grav/plugins/form/templates/forms/fields/turnstile/turnstile.html.twig
2022-11-19 14:59:01 +01:00

16 lines
540 B
Twig

{% extends "forms/field.html.twig" %}
{% set config = grav.config %}
{% set site_key = field.turnstile_site_key ?? config.plugins.form.turnstile.site_key %}
{% set theme = field.theme ?? config.plugins.form.turnstile.theme ?? 'light' %}
{% block label %}{% endblock %}
{% block input %}
{% do assets.addJs('https://challenges.cloudflare.com/turnstile/v0/api.js', { defer: '', async: '' }) %}
<div class="turnstile">
<div class="cf-turnstile" data-sitekey="{{ site_key }}" data-theme="{{ theme }}"></div>
</div>
{% endblock %}