
{% if show_dummy_data == true %}
    {% set article = {
        'url': '/blog/winter-wellness-tips',
        'title': 'Winter Wellness: Essential Tips for Staying Healthy',
        'pagedata': {
            'Image': [{'value': 'no-image.jpg', 'alt': 'Winter wellness tips'}],
            'Author': [{'value': 'Dr. Sarah Johnson'}],
            'Publish Date': [{'value': '15/12/2024 10:30'}],
            'Summary': [{'value': 'Discover essential tips and strategies to maintain your health and wellbeing throughout the winter months.'}],
            'Content': [{'value': '<p>Winter can be challenging for our health and wellbeing. Learn how to boost your immune system, maintain energy levels, and stay healthy during the colder months with our expert advice.</p>'}]
        },
        'listing_container': '0'
    } %}
    {% set image_folders = {
        'cms_images': {
            'news_large': {'path': 'sites/default/images/placeholders/'},
            'news_image': {'path': 'sites/default/images/placeholders/'}
        }
    } %}
    {% set hide_summary = false %}
{% endif %}

<a
        href="{{ article.url }}"
        title="{{ article.title }}"
        class="innerGridItem"
>

    <div class="cardImage">
    
        <picture class="imageWrap">

            {% set article_image = article.pagedata['Image'][0] %}
            {% set image_folder_path = image_folders['cms_images']['news_large']['path'] %}
            {% set image_folder_path_mobile = image_folders['cms_images']['news_image']['path'] %}
   
            {% if article_image['value'] is not empty%}
                <source
                        srcset="/{{ image_folder_path_mobile}}/{{ article_image['value'] }}"
                        media="(max-width: 640px)">
        
                <img
                        src="/{{ image_folder_path }}/{{ article_image['value'] }}"
                        alt="{{ article_image['alt'] }}"
                        loading="lazy"
                />
            {% else %}
                <div class="noImageSvg">
                    {{ file_get_contents(settings.SITE_PATH ~ settings.THEME_URL ~ '/images/icons/picture.svg')|raw }}
                </div> <!-- .noImageSvg -->
            {% endif %}
    
        </picture><!-- .imageWrap -->
        
    </div> <!-- .cardImage -->
    
    <div class="cardHeader">

        <div class="date">
            {% if article.pagedata['Author'][0]['value'] is not empty %}
                {{ article.pagedata['Author'][0]['value'] }} -
            {% endif %}
            {{ create_from_format(article.pagedata['Publish Date'][0]['value'], 'd/m/Y H:i', 'jS F Y') }}
        </div><!-- .date -->

        <h2 class="title">
            {{ article.title|striptags|truncate(34, '...')|raw }}
        </h2>

        {% if hide_summary is empty %}
            <div class="summary">
                {% if article.listing_container == '1' %}
           
                    {% if article.pagedata['Title Banner'][0]['Content']['value'] is not empty %}
                        {{ article.pagedata['Title Banner'][0]['Content']['value']|truncate(200, true, "...")|raw }}
                    {% endif %}
                    
                {% else %}
                    {% if article.pagedata['Summary'][0]['value'] is not empty %}
                        {{ article.pagedata['Summary'][0]['value']|truncate(200, true, "...")|raw }}
                    {% else %}
                        {{ article.pagedata['Content'][0]['value']|striptags|truncate(200, true, "...")|raw }}
                    {% endif %}
                {% endif %}
            </div><!-- .summary -->
        {% endif %}
        
    </div> <!-- .cardHeader -->

    <div class="cardFooter">
        <div class="cardCta">
            <span class="button">Read more</span>
        </div> <!-- .cardCta -->
    </div> <!-- .cardFooter -->
    
    

</a>
