{block name='productlist-index'}
    {block name='productlist-index-include-header'}
        {if !isset($bAjaxRequest) || !$bAjaxRequest}
            {include file='layout/header.tpl'}
        {/if}
    {/block}

    {block name='productlist-index-content'}
        <div id="result-wrapper" data-wrapper="true">
            {$gridRenderContext = []}
            {if !empty($smarty.request.etAjaxFilter)}
                {$gridRenderContext = ["widgetTypes" => ["ProductList"]]}
            {/if}

            {* Include header for productlists - in ET360 this header is reduced heavily because the other content is contained in the grid or other widgets per default *}
            {block name='productlist-index-include-productlist-header'}
                {include file='productlist/header.tpl'}
            {/block}

            {* Determine which grid we need to render *}
            {if isset($oNavigationsinfo) && $oNavigationsinfo->getCategory()}
                {* A category *}
                {et_renderGrid id="category_{$oNavigationsinfo->getCategory()->getID()}" fallbackId="category_main" context=$gridRenderContext}
            {elseif isset($oNavigationsinfo) && $oNavigationsinfo->getManufacturer()}
                {* A manufacturer *}
                {et_renderGrid id="manufacturer_{$oNavigationsinfo->getManufacturer()->getID()}" fallbackId="manufacturer_main" context=$gridRenderContext}
            {elseif isset($oNavigationsinfo) && $oNavigationsinfo->getCharacteristicValue()}
                {* A characteristic value *}
                {et_renderGrid id="propertyvalue_{$oNavigationsinfo->getCharacteristicValue()->getID()}" fallbackId="propertyvalue_main" context=$gridRenderContext}
            {else}
                {* Default to search result general settings for all other product lists *}
                {* We can differentiate if we are looking on a special search page by looking at Shop::$kSuchspecial *}
                {$searchResultGridKey = 'main'}
                {if isset(JTL\Shop::$kSuchspecial) && JTL\Shop::$kSuchspecial > 0}
                    {$searchResultGridKey = JTL\Shop::$kSuchspecial}
                {/if}
                {et_renderGrid id="searchresult_{$searchResultGridKey}" fallbackId="searchresult_main" context=$gridRenderContext}
            {/if}

            {* For actual product list content, see the product_list widget *}
        </div>
    {/block}

    {block name='productlist-index-include-footer'}
        {if !isset($bAjaxRequest) || !$bAjaxRequest}
            {include file='layout/footer.tpl'}
        {/if}
    {/block}
{/block}
