{% set form_attr = {
thankyou: page.getContentMetaValueByKey("lp_thankyou"),
btn_text: page.getContentMetaValueByKey("lp_button"),
btn_color: page.getContentMetaValueByKey("rcs_call_to_action_color")
} %}
{% for i in 0 .. (modules | length) - 1 %}
{# walk down modules and build blocks #}
{% set mod_bg = page.getContentMetaValueByKey("mtm_content_modules_#{i}_rcs_element_background_color") %}
{% set mod_title = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_text_area_title") %}
{% set mod_title_color = page.getContentMetaValueByKey("mtm_content_modules_#{i}_rcs_module_title_color") %}
{# set some defaults #}
{% if mod_bg is empty %}
{% set mod_bg = "#fff" %}
{% endif %}
{% if mod_title_color is empty %}
{% set mod_title_color = "#222" %}
{% endif %}
{% if modules[i] == "mtm_module_hero_image" %}
{% set mod_subhead = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_hero_subheading") %}
{% set mod_image = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_hero_image") %}
{% if mod_image is not empty or mod_subhead is not empty %}
<div class="row" style="min-height: 10px">
<div class="col-sm-12" style="background: {{ mod_bg }}; {% if mod_image is not empty %} padding-bottom: 15px; {% endif %}">
{% set mod_sub = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_hero_subheading") %}
{% if mod_image is not empty %}
{% set mod_image = get_entity("Media", "old_id", mod_image) %}
{% if mod_image is not empty %}
<img
class="mod-hero-image"
src="{{ mod_image.getURL() }}"
alt="{{ mod_image.getTitle() }}"
style="visibility: hidden; display: block;"
loading='lazy'
/>
<img
class="mod-hero-image"
src="{{ mod_image.getURL() }}"
alt="{{ mod_image.getTitle() }}"
style="position:absolute; top: 0; left: 0; right: -15px; width: 100%;"
loading='lazy'
/>
{% endif %}
{% endif %}
{% if mod_subhead is not empty %}
{% if mod_image is not empty %}
<div style="padding-top: 20px;">
{% endif %}
{{ mod_subhead | wordpress | raw }}
{% if mod_image is not empty %}
</div>
{% endif %}
{% endif %}
</div>
</div>
{% endif %}
{% elseif modules[i] == "mtm_module_single_content_area" %}
{% set mod_text = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_module_text_area") %}
{% if mod_text is not empty %}
<div class="row">
<div class="col-md-12 p-3" style="background: {{ mod_bg }};">
{% if mod_title is not empty %}
<h2
class="mod-title"
style="color: {{ mod_title_color }};"
>{{ mod_title }}</h2>
{% endif %}
{% if mod_text is not empty %}
{{ mod_text | wordpress(form_attr) | raw }}
{% endif %}
</div>
</div>
{% endif %}
{% elseif modules[i] == "mtm_module_dual_content_area" %}
{% set mod_text = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_module_text_area") %}
{% set mod_text2 = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_module_text_area_2") %}
{% set mod_bg2 = page.getContentMetaValueByKey("mtm_content_modules_#{i}_rcs_element_background_color_2") %}
{% set mod_title2 = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_text_area_title_2") %}
{% set mod_title_color2 = page.getContentMetaValueByKey("mtm_content_modules_#{i}_rcs_module_title_color_2") %}
{% if mod_bg2 is empty %}
{% set mod_bg2 = "#fff" %}
{% endif %}
{% if mod_title_color2 is empty %}
{% set mod_title_color2 = "#222" %}
{% endif %}
<div class="row">
<div class="col-md-6 p-3" style="background: {{ mod_bg }};">
{% if mod_title is not empty %}
<h2
class="mod-title"
style="color: {{ mod_title_color }};"
>{{ mod_title }}</h2>
{% endif %}
{% if mod_text is not empty %}
{{ mod_text | wordpress(form_attr) | raw }}
{% endif %}
</div>
<div class="col-md-6 p-3" style="background: {{ mod_bg2 }};">
{% if mod_title2 is not empty %}
<h2
class="mod-title"
style="color: {{ mod_title_color }};"
>{{ mod_title2 }}</h2>
{% endif %}
{% if mod_text2 is not empty %}
{{ mod_text2 | wordpress(form_attr) | raw }}
{% endif %}
</div>
</div>
{% elseif modules[i] == "mtm_module_listgrid" %}
{# list grid #}
{% set looping = true %}
{% for j in 0..5000 %}
{% if looping %}
{% set grid_heading = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_add_list_item_#{j}_mtm_list_item_heading") %}
{% set grid_link = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_add_list_item_#{j}_mtm_list_item_link") %}
{% set grid_image = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_add_list_item_#{j}_mtm_list_item_image") %}
{% if grid_heading is empty %}
{% set looping = false %}
{% endif %}
{% if j == 50 %}
<div class="row">
<div class="col-md-12">
<h1 id="2017" style="margin-bottom:unset">2017</h1>
<hr style="border-top: 6px solid #a6252a; margin-top: unset;">
</div>
</div>
{% elseif j == 102 %}
<div class="row">
<div class="col-md-12">
<h1 id="2016" style="margin-bottom:unset">2016</h1>
<hr style="border-top: 6px solid #a6252a; margin-top: unset;" />
</div>
</div>
{% endif %}
<div class="row my-3">
{% if grid_image is not empty %}
{% set grid_image = get_entity("Media", "old_id", grid_image) %}
<div class="col-md-3">
{% if grid_image is not empty %}
<a href="{{ grid_link }}" ><img
class="mod-gridlist-image"
src="{{ grid_image.getURL() }}"
alt="{{ grid_image.getTitle() }}"/></a>
{% else %}
[default image]
{% endif %}
</div>
<div class="col-md-9">
{% else %}
<div class="col-md-12">
{% endif %}
<a href="{{ grid_link }}" >{{ grid_heading }}</a>
</div>
</div>
{% endif %}
{% endfor %}
{% elseif modules[i] == "mtm_module_gridlist_posts" %}
{# eg. /meet-rcs-influencers #}
{% set grid_cols = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_grid_archive_per_row") %}
{% set grid_type = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_list_archive_select") %}
{% if grid_type == 'Add Posts Manually' %}
{% set grid_posts = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_list_archive_manual_posts") %}
{% set grid_posts = unserialize(grid_posts) %}
{% set gi = 0 %}
<div class="row">
{% for post_id in grid_posts %}
{% if gi is not empty and gi is divisible by(grid_cols) %}
</div>
<div class="row">
{% endif %}
<div class="col-md-{{ 12 / grid_cols }}">
{% set grid_content = get_entity("Content", "old_id", post_id) %}
{% if grid_content is not empty %}
<a href="{{ grid_content.getURL() }}">
{{ grid_content.getFeaturedImageTag("","")|raw }}
</a>
<a href="{{ grid_content.getURL() }}">{{ grid_content.getTitle() }} </a>
{% endif %}
</div>
{% set gi = gi + 1 %}
{% endfor %}
</div>
{% endif %}
{% elseif modules[i] == "mtm_module_logo_showcase" %}
{# eg. /partners #}
{% set logo_count = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_logo_repeater") %}
{% set trade_count = page.getContentMetaValueByKey("rcs_trade_association_repeater") %}
{% if logo_count is not empty %}
{#<div class="row">#}<ul style="width: 100%; display: table; table-layout: fixed; border-collapse: collapse;">
{% for j in 0 .. (logo_count - 1) %}
{# % set logo_image = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_logo_repeater_#{j}_mtm_logo_image") % #}
{% set logo_image = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_logo_repeater_#{j}_mtm_logo_image") %}
{% set logo_link = page.getContentMetaValueByKey("mtm_content_modules_#{i}_mtm_logo_repeater_#{j}_mtm_logo_link") %}
{% set logo_image = get_entity("Media", "old_id", logo_image) %}
{% if logo_image is not empty %}
{#<div class="col-md-3">#}<li style="display: table-cell; text-align: center; vertical-align: middle; padding: 1.7em 1em;">
{% if logo_link is not empty %}
<a href="{{ logo_link }}">
{% endif %}
<img
src="{{ logo_image.getURL() }}"
title="{{ logo_image.getTitle() }}"
loading='lazy'
/>
{% if logo_link is not empty %}
</a>
{% endif %}
{#</div>#}</li>
{% endif %}
{% endfor %}
{#</div>#}</ul>
{% endif %}
{% if trade_count is not empty %}
{% for j in 0 .. (trade_count - 1) %}
{% set trade_name = page.getContentMetaValueByKey("rcs_trade_association_repeater_#{j}_rcs_trade_association_name") %}
{% set trade_website = page.getContentMetaValueByKey("rcs_trade_association_repeater_#{j}_rcs_trade_association_website") %}
{% set trade_location = page.getContentMetaValueByKey("rcs_trade_association_repeater_#{j}_rcs_trade_association_location") %}
{% set trade_phone = page.getContentMetaValueByKey("rcs_trade_association_repeater_#{j}_rcs_trade_association_phone_number") %}
<div class="row my-3">
<div class="col-md-12">
<h4 class="my-0">{{ trade_name }}</h4>
<div class="trade-association--info">
<p class="my-0">{{ trade_location }} | {{ trade_phone }}</p>
<a href="{{ trade_website }}">Visit Website</a>
</div>
</div>
</div>
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}