{% if title is empty %}
    {% set title = p.pagedata['CTA Banner'][0]['Title']['value'] %}
{% endif %}

{% if content is empty %}
    {% set content = p.pagedata['CTA Banner'][0]['Content']['value'] %}
{% endif %}

{% if button_text is empty %}
    {% set button_text = p.pagedata['CTA Banner'][0]['Button Text']['value'] %}
{% endif %}

{% if link is empty %}
    {% set link = p.pagedata['CTA Banner'][0]['Button Link']['value'] %}
{% endif %}


{% if link is not empty and link is not empty %}

    <div class="ctaBanner {% if dark_background is not empty %} hasBackground{% endif %} {% if inverted is not empty %} inverted{% endif %} {{ class }}">

        <div class="wrapper">

            <div class="innerCtaBanner">

                <a href="{{ link }}">

                    {% if title is not empty %}
                        <div class="titleWrapper">
                            <h3>
                                {{ title }}
                            </h3>
                        </div> <!-- .titleWrapper -->
                    {% endif %}

                    {% if content is not empty %}
                        <div class="contentWrapper">
                            <div class="wysiwyg contentContainer">
                                {{ content|raw }}
                            </div> <!-- .wysiwyg -->

                            {% if meta_content is not empty %}
                                <div class="bannerMeta">
                                    {{ meta_content|raw }}
                                </div> <!-- .bannerMeta -->
                            {% endif %}

                        </div> <!-- .contentWrapper -->
                    {% endif %}

                    {% if button_text is not empty %}
                        <div class="buttonWrapper">
                            <button type="button" class="button">
                                {{ button_text }}
                                <i class="far fa-long-arrow-right"></i>
                            </button>
                        </div> <!-- .buttonWrapper -->
                    {% endif %}

                </a>

            </div> <!-- .innerCtaBanner -->

        </div> <!-- .wrapper -->

    </div> <!-- .ctaBanner -->
{% endif %}
