{# QR Code Module - Self-hosted QR code generator #} {# Shorthand variables for cleaner code #} {% set c = module.content %} {% set s = module.style %} {# Module Variables. For 'current_page' we emit EMPTY content and let the init JS read window.location.href client-side — server-rendering request.full_url makes the whole page ineligible for HubSpot prerender caching (TTFB hit on every page). #} {% set qr_content = c.content_type == 'current_page' ? '' : c.custom_content %} {% set qr_id = "qr-code-" ~ name %} {# Module HTML #}
{% if c.show_title %}

{{ c.title }}

{% endif %} {% if c.show_description %}

{{ c.description }}

{% endif %} {% if c.show_download %} {% endif %} {% if c.show_text %} {# For current_page the URL is filled in client-side by qr-code-init.js. #}

{{ c.text_label }}: {% if c.content_type != 'current_page' %}{{ qr_content|truncate(50) }}{% endif %}

{% endif %}
{# Inline styles for this module instance #} {# Load QR library + init via require_js so HubSpot dedupes them when several QR modules share a page (raw