[{if !$oView->getArticleCount()}]
    <h3>[{oxcontent ident="d3extsearch_noarticlefound" field="oxtitle"}]</h3>
    [{oxcontent ident="d3extsearch_noarticlefound"}]
[{/if}]

[{if $oView->d3GetCMSList()}]
    <div class="d3extsearch_mobile">
        <h3>
            [{oxmultilang ident="D3_EXTSEARCH_EXT_CMSHEADLINE"}]
        </h3>
        <div class="content list">
            <ul style="margin: 2px;">
                [{foreach from=$oView->d3GetCMSList() item="oContent"}]
                    [{assign var="TitleCharCount" value=$oContent->oxcontents__oxtitle->value|count_characters}]
                    [{math equation="100-s" s=$TitleCharCount assign="iTextLength"}]
                    <li>
                        <a href="[{$oContent->getLink()}]"><b>[{$oContent->oxcontents__oxtitle->value}]</b></a><br>
                    </li>
                [{/foreach}]
            </ul>
        </div>
    </div>
[{/if}]

[{assign var="similarSearch" value=$oView->getSearchResultStatusMessage()}]
[{if $similarSearch}]
    <div class="d3extsearch_mobile">
        <div class="message">
            [{if $similarSearch == 'similar'}]
                [{oxmultilang ident="D3_EXTSEARCH_EXT_NOARTMSG"}] [{$oView->getUsedParams()}]
            [{elseif $similarSearch == 'combined'}]
                [{oxmultilang ident="D3_EXTSEARCH_EXT_LESSARTMSG"}]
            [{/if}]
        </div>
    </div>
[{/if}]

[{if $oView->getArticleCount()}]
    <div id="filterItems" class="filter-box">
        <div class="filter-box-closed" id="filterBoxClosed">
            <input class="btn" type="button" value="[{oxmultilang ident="FILTER_LIST"}]">
        </div>
        <div id="filterBoxOpened" class="filter-box-opened">
            <div class="filter-header">
                <span class="filter-close"><i class="glyphicon-remove"></i></span>
                <span class="filter-open-title">[{oxmultilang ident="FILTER_LIST"}]</span>
            </div>
            <div class="filterData">

                [{if $aSemanticHits
                    || $oView->d3getCategoryList()|count
                    || $sSelectedCatId
                    || $oView->d3getVendorList()|count
                    || $sSelectedVendorId
                    || $oView->d3getManufacturerList()|count
                    || $sSelectedManufacturerId
                    || $oView->d3getPriceSteps()
                    || $oView->d3GetAttributeList()}]

                    <script type="text/javascript">
                        function d3extSearchSubmitFilter(sInputId, mValue)
                        {
                            document.getElementById(sInputId).value = mValue;
                            //document.getElementById('filterlist').submit();
                        }
                    </script>
                    <form action="[{$oViewConf->getSelfActionLink()}]" method="post" name="_filterlist" id="filterList">
                        [{$oViewConf->getHiddenSid()}]
                        <input type="hidden" name="cl" value="search">
                        <input type="hidden" name="searchparam" value="[{$oView->getSearchParamForHtml()}]">
                        <input type="hidden" name="fnc" value="">
                        <input type="hidden" name="isextsearch" value="true">
                        <input type="hidden" name="showFilter" value="false">
                        [{foreach from=$oView->getNavigationParams() key="keyname" item="value"}]
                            [{if $keyname != 'searchcnid' && $keyname != 'searchvendor' && $keyname != 'searchmanufacturer'}]
                                <input type="hidden" name="[{$keyname}]" value="[{$value}]">
                            [{/if}]
                        [{/foreach}]
                        [{assign var="blFilterOpen" value=false}]

                        [{block name="d3_inc_ext_search__filter"}]
                            [{*** check ***}]
                            [{if $aSemanticHits}]
                                <label class="filter-title">[{oxmultilang ident="D3_EXTSEARCH_EXT_YOUMEAN"}]</label>
                                <div class="dropdown">
                                    <input type="hidden" id="semanticlist" name="semanticlist" value="">
                                    <div class="dropdown-toggle" data-toggle="dropdown" data-target="#">
                                        <span>
                                            [{*** cat?? ***}]
                                            [{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSECAT"}]
                                        </span>
                                        <i class="glyphicon-chevron-down"></i>
                                    </div>
                                    <ul class="dropdown-menu" role="menu">
                                        [{foreach from=$aSemanticHits item="sSemantic"}]
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="[{$sSemantic->sLink}]" title="[{$sSemantic->sWord}]" onclick="d3extSearchSubmitFilter('semanticlist', this.getAttribute('data-selection-id'));">
                                                    [{$sSemantic->sWord}]
                                                </a>
                                            </li>
                                        [{/foreach}]
                                    </ul>
                                </div>
                            [{/if}]

                            [{if $oView->d3getCategoryList()|count || $sSelectedCatId}]
                                <label class="filter-title">[{oxmultilang ident="D3_EXTSEARCH_EXT_CATEGORIES"}]</label>
                                <div class="dropdown">
                                    <input type="hidden" id="searchcnid" name="searchcnid" value="[{$sSelectedCatId}]">
                                    <div class="dropdown-toggle" data-toggle="dropdown" data-target="#">
                                        <span>
                                            [{if $sSelectedCatId}]
                                                [{$sSelectedCat}]
                                                [{assign var="blFilterOpen" value=true}]
                                            [{else}]
                                                [{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSECAT"}]
                                            [{/if}]
                                        </span>
                                        <i class="glyphicon-chevron-down"></i>
                                    </div>
                                    <ul class="dropdown-menu" role="menu">
                                        [{if $sSelectedCatId}]
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="" onclick="d3extSearchSubmitFilter('searchcnid', this.getAttribute('data-selection-id'));">
                                                    [{oxmultilang ident="D3_EXTSEARCH_EXT_SEARCHINCATEGORIES"}]
                                                </a>
                                            </li>
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="[{$sSelectedCatId}]" class="selected">
                                                    [{$sSelectedCat}]
                                                </a>
                                            </li>
                                        [{/if}]
                                        [{foreach from=$oView->d3getCategoryList() item="category"}]
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="[{$category->getId()}]" title="[{$category->oxcategories__oxtitle->getRawValue()}]" [{if $sSelectedCatId == $category->getId()}]class="selected"[{/if}] onclick="d3extSearchSubmitFilter('searchcnid', this.getAttribute('data-selection-id'));">
                                                    [{$category->getTitle()}][{if $category->getFieldData('counter')}] ([{$category->getFieldData('counter')}])[{/if}]
                                                </a>
                                            </li>
                                        [{/foreach}]
                                    </ul>
                                </div>
                            [{/if}]

                            [{if $oView->d3getVendorList()|count || $sSelectedVendorId}]
                                <label class="filter-title">[{oxmultilang ident="D3_EXTSEARCH_EXT_VENDORS"}]</label>
                                <div class="dropdown">
                                    <input type="hidden" id="searchvendor" name="searchvendor" value="[{$sSelectedVendorId}]">
                                    <div class="dropdown-toggle" data-toggle="dropdown" data-target="#">
                                        <span>
                                            [{if $sSelectedVendorId}]
                                                [{$sSelectedVendor}]
                                                [{assign var="blFilterOpen" value=true}]
                                            [{else}]
                                                [{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSEVENDOR"}]
                                            [{/if}]
                                        </span>
                                        <i class="glyphicon-chevron-down"></i>
                                    </div>
                                    <ul class="dropdown-menu" role="menu">
                                        [{if $sSelectedVendorId}]
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="" onclick="d3extSearchSubmitFilter('searchvendor', this.getAttribute('data-selection-id'));">
                                                    [{oxmultilang ident="D3_EXTSEARCH_EXT_SEARCHINVENDORS"}]
                                                </a>
                                            </li>
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="[{$sSelectedVendorId}]" class="selected">
                                                    [{$sSelectedVendor}]
                                                </a>
                                            </li>
                                        [{/if}]
                                        [{foreach from=$oView->d3getVendorList() item="vendor"}]
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="[{$vendor->getId()}]" title="[{$vendor->oxvendor__oxtitle->getRawValue()}]" [{if $sSelectedVendorId == $vendor->getId()}]class="selected"[{/if}] onclick="d3extSearchSubmitFilter('searchvendor', this.getAttribute('data-selection-id'));">
                                                    [{$vendor->getTitle()}][{if $vendor->getFieldData('counter')}] ([{$vendor->getFieldData('counter')}])[{/if}]
                                                </a>
                                            </li>
                                        [{/foreach}]
                                    </ul>
                                </div>
                            [{/if}]


                            [{if $oView->d3getManufacturerList()|count || $sSelectedManufacturerId}]
                                <label class="filter-title">[{oxmultilang ident="D3_EXTSEARCH_EXT_MANUFACTURERS"}]</label>
                                <div class="dropdown">
                                    <input type="hidden" id="searchmanufacturer" name="searchmanufacturer" value="[{$sSelectedManufacturerId}]">
                                    <div class="dropdown-toggle" data-toggle="dropdown" data-target="#">
                                        <span>
                                            [{if $sSelectedManufacturerId}]
                                                [{$sSelectedManufacturer}]
                                                [{assign var="blFilterOpen" value=true}]
                                            [{else}]
                                                [{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSEMANUFACTURER"}]
                                            [{/if}]
                                        </span>
                                        <i class="glyphicon-chevron-down"></i>
                                    </div>
                                    <ul class="dropdown-menu" role="menu">
                                        [{if $sSelectedManufacturerId}]
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="" onclick="d3extSearchSubmitFilter('searchmanufacturer', this.getAttribute('data-selection-id'));">
                                                    [{oxmultilang ident="D3_EXTSEARCH_EXT_SEARCHINMANUFACTURERS"}]
                                                </a>
                                            </li>
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="[{$sSelectedManufacturerId}]" class="selected">
                                                    [{$sSelectedManufacturer}]
                                                </a>
                                            </li>
                                        [{/if}]
                                        [{foreach from=$oView->d3getManufacturerList() item="manufacturer"}]
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="[{$manufacturer->getId()}]" title="[{$manufacturer->oxmanufacturers__oxtitle->getRawValue()}]" [{if $sSelectedManufacturerId == $manufacturer->getId()}]class="selected"[{/if}] onclick="d3extSearchSubmitFilter('searchmanufacturer', this.getAttribute('data-selection-id'));">
                                                    [{$manufacturer->getTitle()}][{if $manufacturer->getFieldData('counter')}] ([{$manufacturer->getFieldData('counter')}])[{/if}]
                                                </a>
                                            </li>
                                        [{/foreach}]
                                    </ul>
                                </div>
                            [{/if}]

                            [{if $oView->d3GetAttributeList()}]
                                [{foreach from=$oView->d3GetAttributeList() name=search key=key item=oAttribute}]
                                    <label class="filter-title">[{$oAttribute->title}]:</label>
                                    <div class="dropdown">
                                        <input type="hidden" id="d3searchattrib__[{$key}]" name="d3searchattrib[[{$key}]]" value="[{$oAttribute->selectionRawValue}]">
                                        <div class="dropdown-toggle" data-toggle="dropdown" data-target="#">
                                            <span>
                                                [{if $oAttribute->selected}]
                                                    [{$oAttribute->selectionValue}]
                                                    [{assign var="blFilterOpen" value=true}]
                                                [{else}]
                                                    [{oxmultilang ident="D3_EXTSEARCH_EXT_ATTRIBSNOSELECTION1"}] [{$oAttribute->title}] [{oxmultilang ident="D3_EXTSEARCH_EXT_ATTRIBSNOSELECTION2"}]
                                                [{/if}]
                                            </span>
                                            <i class="glyphicon-chevron-down"></i>
                                        </div>
                                        <ul class="dropdown-menu" role="menu">
                                            [{if $oAttribute->selected}]
                                                <li class="dropdown-option">
                                                    <a tabindex="-1" data-selection-id="" onclick="d3extSearchSubmitFilter('d3searchattrib__[{$key}]', this.getAttribute('data-selection-id'));">
                                                        [{oxmultilang ident="D3_EXTSEARCH_EXT_ATTRIBSDESELECT1"}] [{$oAttribute->title}] [{oxmultilang ident="D3_EXTSEARCH_EXT_ATTRIBSDESELECT2"}]
                                                    </a>
                                                </li>
                                            [{/if}]
                                            [{foreach from=$oAttribute->_aList name="attrvalues" key="valuekey" item="oAttrValue"}]
                                                <li class="dropdown-option">
                                                    <a tabindex="-1" data-selection-id="[{$oAttrValue->rawvalue}]" title="[{$oAttrValue->value}]" style="[{if $oAttrValue->highlighted}]background-color: #E2E2E2;[{/if}]" [{if $oAttrValue->selected}]class="selected"[{/if}] onclick="d3extSearchSubmitFilter('d3searchattrib__[{$key}]', this.getAttribute('data-selection-id'));">
                                                        [{$oAttrValue->value}] [{if $oAttrValue->count}]([{$oAttrValue->count}])[{/if}]
                                                    </a>
                                                </li>
                                            [{/foreach}]
                                        </ul>
                                    </div>
                                [{/foreach}]
                            [{/if}]

                            [{if $oView->d3getPriceSteps() || $sSelectedPriceStep}]
                                [{assign var="currency" value=$oView->getActCurrency()}]
                                <label class="filter-title">[{oxmultilang ident="D3_EXTSEARCH_EXT_PRICECATS"}]</label>
                                <div class="dropdown">
                                    <input type="hidden" id="priceselector" name="priceselector" value="[{$sSelectedManufacturerId}]">
                                    <div class="dropdown-toggle" data-toggle="dropdown" data-target="#">
                                        <span>
                                            [{if $sSelectedPriceStep}]
                                                [{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSEPRICE"}]
                                                [{assign var="blFilterOpen" value=true}]
                                            [{else}]
                                                [{oxmultilang ident="D3_EXTSEARCH_EXT_CHOOSEPRICE"}]
                                            [{/if}]
                                        </span>
                                        <i class="glyphicon-chevron-down"></i>
                                    </div>
                                    <ul class="dropdown-menu" role="menu">
                                        [{if $sSelectedPriceStep}]
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="" onclick="d3extSearchSubmitFilter('priceselector', this.getAttribute('data-selection-id'));">
                                                    [{oxmultilang ident="D3_EXTSEARCH_EXT_DESELECTPRICE"}]
                                                </a>
                                            </li>
                                        [{/if}]
                                        [{foreach from=$oView->d3getPriceSteps() item="price"}]
                                            <li class="dropdown-option">
                                                <a tabindex="-1" data-selection-id="[{$price->addParam}]" title="[{oxmultilang ident="D3_EXTSEARCH_EXT_PRICEFROM"}] [{$price->iFMin}] [{$currency->sign}] [{oxmultilang ident="D3_EXTSEARCH_EXT_PRICETO"}] [{$price->iFMax}] [{$currency->sign}]" onclick="d3extSearchSubmitFilter('priceselector', this.getAttribute('data-selection-id'));">
                                                    [{oxmultilang ident="D3_EXTSEARCH_EXT_PRICEFROM"}] [{$price->iFMin}] [{$currency->sign}] [{oxmultilang ident="D3_EXTSEARCH_EXT_PRICETO"}] [{$price->iFMax}] [{$currency->sign}][{if $price->iCount != ''}] ([{$price->iCount}])[{/if}]
                                                </a>
                                            </li>
                                        [{/foreach}]
                                    </ul>
                                </div>

                            [{/if}]

                        [{/block}]

                    </form>
                [{/if}]
            </div>

            [{if $oView->hasFilterParams()}]
                <div class="d3extsearch_mobile spacer">
                    [{assign var="sTplPath" value=$oViewConf->getModulePath('d3_extsearch')|cat:"views/tpl/"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fdesc="D3_EXTSEARCH_EXT_ALL"|oxmultilangassign d3fparam="all"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="1"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="2"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="3"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="4"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="5"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="6"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="7"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="8"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="9"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="0"}]
                    <div style="clear: both;"></div>
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="A"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="B"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="C"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="D"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="E"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="F"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="G"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="H"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="I"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="J"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="K"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="L"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="M"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="N"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="O"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="P"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="Q"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="R"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="S"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="T"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="U"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="V"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="W"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="X"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="Y"}]
                    [{include file=$sTplPath|cat:"d3_ext_search_filter.tpl" d3fparam="Z"}]
                    <div style="clear: both;"></div>
                </div>
            [{/if}]
        </div>


        [{oxscript add="$('div.dropdown').oxDropDown();"}]
        [{oxscript include="js/widgets/oxattribute.js" priority=10}]
        [{oxscript add="$('#filterItems').oxAttribute({blShowFilter:'$blFilterOpen'});"}]
        [{oxscript add="$('#sortItems').oxAttribute({blShowFilter:'$blFilterOpen'});"}]

    </div>
[{/if}]