{% set card_data = category.getCategoryCardData(false) %}

{% extends 'layouts/default.twig' %}

{% block content %}

    {% set scrollTo = false %}

    {% if card_data.actionUrl %}

        {% set button_attached = true %}

    {% else %}
        {% set button_text_2 = 'View treatments' %}
        {% set read_more_link = '#categoryItems' %}
        {% set scrollTo = true %}
    {% endif %}

    {% set subtitle = '' %}

    {% if category.parent %}
        {% set subtitle = category.parent.name %}
    {% endif %}
    
 

    {% include 'includes/page_blocks/title_banner.twig' with {
        banner: hero_banner,
        category_image: true,
        class: 'categoryHero',
        left_aligned: true,
        hide_subtitle: true,
        icon_points: hero_banner_points,
        raw_content: true,
        card_data: card_data
    }%}

    <div class="categoryLanding">

        {% if sub_categories is not empty %}

            <div class="onlineDoctorCategories subCategories noPattern">

                {% include 'includes/elements/intro_block.twig' with {
                    intro_title: 'Conditions',
                    intro_content: '',
                    class: ''
                }%}

                <div class="wrapper">

                    <div class="onlineDoctorWrap">


                        {% include 'shop/category/card_list.twig' with {
                            categories: sub_categories
                        } %}


                    </div> <!-- .onlineDoctorWrap -->

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

            </div> <!-- .onlineDoctorCategories -->

        {% else %}


            <div id="categoryItems" class="landingItemsWrap">

                <div class="wrapper">

                    
                    {% if items_doctor is not empty or items_standard is not empty %}

                        {% if items_doctor is not empty %}
                            
                            <category-products
                                    :set-products="{{ items_doctor | json_encode }}"
                                    :set-parent-category="{{ category | json_encode }}"
                                    list-title="Prescription medications"
                                    list-content=""
                            ></category-products>
                        
                        {% endif %}

                        {% if items_standard is not empty %}
                            
                            <category-products
                                    :set-products="{{ items_standard | json_encode }}"
                                    list-title="Pharmacy medications"
                            ></category-products>
                            
                        {% endif %}
                    
                    {% endif %}
                    

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

            </div><!-- .landingItemsWrap -->

            {% include 'includes/page_blocks/image_banner.twig' with {
                banner:  description_block,
                image_position: 'right',
                show_testimonial: false,
                image_folder: 'category_images',
                image_top_mobile: true
            }%}



        {% endif %}

        {% set rendered = render_entity_blocks('category', category.id) %}
        {% if rendered %}
            {{ rendered | raw }}
        {% endif %}

    </div> <!-- .categoryLanding -->
   
    
{% endblock %}
