标签列表

{openzc:filter}产品筛选导航


# 可调用字段 说明
1 [field:filter_item/] 筛选项目名称
2 [field:filter_name/] 筛选条件值名称
3 [field:filter_link/] 筛选条件链接
4 [field:filter_id/] ID,偶尔会用到


参数:item="筛选项目",space="价格间隔",options_id="属性ID",mul="多选/单选",active_class="已选样式名称(默认'active')"
字段:filter_name,filter_link,filter_count,status
说明:用于产品列表筛选



已筛选项目:
{openzc:filter item="active"}
<li>
        <a href="#">[field:filter_item/]</a>
        <div>
            {openzc:filter type="son"}
		<a href="[field:filter_link/]">[field:filter_name/]</a>
	    {/openzc:filter}
        </div>
        {openzc:if $field["filter_item"]=="clear"}
            <a href="[field:filter_link/]">Clear Filter</a>
        {/openzc:if}
</li>
{/openzc:filter}

清除筛选条件:
{openzc:filter item="clear"}
<li>
    <a href="[field:filter_link/]">Clear Filter </a>
</li>
{/openzc:filter}

常用调用:项目之间筛选条件为交集

//品牌筛选,mul=true为多选、false单选,不填为单选
{openzc:filter item="brand" mul="true"}
    <li>
        <a href="#">[field:filter_item/]</a>
        <div>
			{openzc:filter type="son"}
				{openzc:if $field['status']=='active'}
					<a href="[field:filter_link/]">√ [field:filter_name/] ([field:filter_count/])</a>
				{else}
					<a href="[field:filter_link/]">[field:filter_name/] ([field:filter_count/])</a>
				{/openzc:if}
			{/openzc:filter}
        </div>
    </li>
{/openzc:filter}

//space:以站点默认货币的价格为单位,例子中以$20为间隔生成价格筛选菜单
{openzc:filter item="price" space="20" mul="true"}
    <li>
        <a href="#">[field:filter_item/]</a>
        <div>
			{openzc:loopson type="son"}
				{openzc:if $field['status']=='active'}
					<a href="[field:filter_link/]">√ [field:filter_name/] ([field:filter_count/])</a>
				{else}
					<a href="[field:filter_link/]">[field:filter_name/] ([field:filter_count/])</a>
				{/openzc:if}
			{/openzc:loopson}
        </div>
    </li>
{/openzc:filter}

//使用价格区间滑动样式时slide="true"(若使用ajax时需添加data-reload局部重加载)
{openzc:filter item="price" slide="true"}
  <h1>[field:filter_item/]</h1>
  <ul>
    {openzc:loopson type="son"}
    <li>
	 <input class="openzc-input" type="hidden" name="filter-price-link" value="[field:filter_link/]"/>
     <input class="openzc-input" type="text" value="[field:min/]" name="filter-price-min" data-action="filterPrice" data-reload="leftfilter,class:rightlist"/><br/>
	 <input class="openzc-input" type="text" value="[field:max/]" name="filter-price-max" data-action="filterPrice" data-reload="leftfilter,class:rightlist"/>
    </li>
    {/openzc:loopson}
  </ul>
</section>
{/openzc:filter}

//属性筛选,如果需要指定属性,可设定options_id
{openzc:filter item="attr" mul="true" options_id="1,2"}......{/openzc:filter}
{openzc:filter item="attr" mul="true"}
    <li class="uk-open">
        <a href="#">[field:filter_item/]</a>
        <div>
			{openzc:loopson type="son"}
				{openzc:if $field['status']=='active'}
					<a href="[field:filter_link/]">√ [field:filter_name/] ([field:filter_count/])</a>
				{else}
					<a href="[field:filter_link/]">[field:filter_name/] ([field:filter_count/])</a>
				{/openzc:if}
			{/openzc:loopson}
        </div>
    </li>
{/openzc:filter}