{# Import smart link macro for intelligent URL handling #} {% import "../../includes/macros/smart-link.html" as links %} {% set c = module.content %} {% set s = module.style %} {% set colors = module.colors %} {% set spacing = module.spacing %} {% set a = module.advanced %} {# Build CSS classes #} {% set module_classes = "comparison-table" %} {% if s.row_striping %} {% set module_classes = module_classes ~ " comparison-table--striped" %} {% endif %} {% if s.sticky_header %} {% set module_classes = module_classes ~ " comparison-table--sticky" %} {% endif %} {% if a.custom_class %} {% set module_classes = module_classes ~ " " ~ a.custom_class %} {% endif %} {% set num_cols = c.columns|length %}
{# Section Header #} {% if c.section_heading or c.section_subheading %}
{% if c.section_heading %}

{{ c.section_heading|escape }}

{% endif %} {% if c.section_subheading %}

{{ c.section_subheading|escape }}

{% endif %}
{% endif %} {# Table Container (for scroll on mobile) #}
{# Table Header #} {% for col in c.columns %} {% endfor %} {# Table Body #} {% for row in c.rows %} {% if row.is_category %} {% else %} {% for i in range(num_cols) %} {% set col = c.columns[i] %} {% set val_key = "value_" ~ (i + 1) %} {% set text_key = "text_" ~ (i + 1) %} {% set value = row[val_key]|default('check') %} {% set text = row[text_key]|default('') %} {% endfor %} {% endif %} {% endfor %} {# CTA Row (if any column has CTA) #} {% if c.columns | selectattr('cta_text') | selectattr('cta_url') | list | length %} {% for col in c.columns %} {% endfor %} {% endif %}
Feature {% if col.highlight and col.highlight_text %} {{ col.highlight_text|escape }} {% endif %} {{ col.column_name|escape }} {% if col.column_subtitle %} {{ col.column_subtitle|escape }} {% endif %}
{{ row.feature_name|escape }}
{{ row.feature_name|escape }} {% if row.feature_tooltip %} {% endif %} {% if value == "check" %} {% elif value == "x" %} {% elif value == "partial" %} {% elif value == "text" %} {{ text|escape }} {% endif %}
{% if col.cta_text and col.cta_url %} {{ col.cta_text|escape }} {% endif %}
{% require_css %} {% end_require_css %}