---
brand:
    products:
        limit: {{theme_settings.brandpage_products_per_page}}
---
{{inject "brandProductsPerPage" theme_settings.brandpage_products_per_page}}
{{#partial "head"}}
    {{#if pagination.brand.previous}}
        <link rel="prev" href="{{{pagination.brand.previous}}}">
    {{/if}}
    {{#if pagination.brand.next}}
        <link rel="next" href="{{{pagination.brand.next}}}">
    {{/if}}
{{/partial}}

{{#partial "page"}}
{{> components/common/breadcrumbs breadcrumbs=breadcrumbs}}
{{#if brand.image}}
    <div class="brand-image-container">
        {{> components/common/responsive-img
            image=brand.image
            fallback_size=theme_settings.thumb_size
            lazyload='disabled'
        }}
    </div>
{{/if}}
<h1 class="page-heading">{{brand.name}}</h1>
{{{region name="brand_below_header"}}}
<div class="page">
    <aside class="page-sidebar" id="faceted-search-container">
        {{> components/brand/sidebar}}
    </aside>

    <main class="page-content" id="product-listing-container">
        {{#if brand.search_error }}
            <p>{{lang 'search.errorMessage'}}</p>
        {{else}}
            {{#if brand.products}}
                {{> components/brand/product-listing}}
            {{else}}
                <p>{{lang 'brands.no_products'}}</p>
            {{/if}}
            {{{region name="brand_below_content"}}}
        {{/if}}
    </main>
</div>

{{/partial}}
{{> layout/base}}
