{% macro render(content, cms, config='') %} {%- set backgroundColour = '' -%} {%- if content.heroBackground and content.heroBackground.class -%} {%- set backgroundColour = content.heroBackground.class -%} {%- endif -%} {%- set homeHero = false -%} {%- if config.homeHero -%} {%- set homeHero = config.homeHero -%} {%- endif -%}
{% if content.heading %}

{{content.heading|safe}}

{% endif %}
{% if content.bodyText %}

{{content.bodyText|safe}}

{% endif %}

{% if content.appStoreLink %} {% with appStoreLink = cms.get_entry(content.appStoreLink.sys.id) %} {{appStoreLink.fields.title.data}} {% endwith %} {% endif %} {% if content.googlePlayLink %} {% with googlePlayLink = cms.get_entry(content.googlePlayLink.sys.id) %} {{googlePlayLink.fields.title.data}} {% endwith %} {% endif %} {% if content.button %} {% with button = cms.get_entry(content.button.sys.id) %} {%- set href = {} -%} {% if button.type == 'internalLink' %} {% if button.data.fields.page %} {% with internalLink = cms.get_entry(button.data.fields.page.sys.id) %} {%- set _ = href.update({"url" : tenant_url_path + internalLink.full_url_path}) -%} {% endwith %} {% endif %} {% else %} {%- set _ = href.update({"url" : button.fields.url.data }) -%} {% endif %} {{button.fields.title.data|safe}} {% endwith %} {% endif %} {% if content.link %} {% with link = cms.get_entry(content.link.sys.id) %} {%- set href = {} -%} {% if link.type == 'internalLink' %} {% if link.data.fields.page %} {% with internalLink = cms.get_entry(link.data.fields.page.sys.id) %} {%- set _ = href.update({"url" : tenant_url_path + internalLink.full_url_path}) -%} {% endwith %} {% endif %} {% else %} {%- set _ = href.update({"url" : link.fields.url.data }) -%} {% endif %}

{{link.fields.title.data|safe}}

{% endwith %} {% endif %}

{% if content.image %} {% with image = cms.get_asset(content.image.sys.id) %} {% if image.data.fields.description %} {% set altText = image.data.fields.description %} {% else %} {% set altText = image.data.fields.title %} {% endif %} {% set imageDimensions = { 'width': image.data.fields.file.details.image.width, 'height': image.data.fields.file.details.image.height } %}
{{altText}}
{% endwith %} {% endif %}
{% endmacro %}