易优Screening筛选标签-Eyoucms标签手册
[基础用法]
名称:screening
功能:筛选文章
语法:
{eyou:screening id='field' currentstyle='active' alltxt='不限' } <div class="row"> <div class="filter-box"> <!-- 筛选项栏目循环 --> {eyou:volist name='$field.list' id='vo'} <div class="filter-boxs"> <!-- 筛选项标题 --> <div class="filter-tit"> {$vo.title} : </div> <!-- 筛选的可选值循环 --> <div class="filter-cen"> {eyou:volist name='$vo.dfvalue' id='val'} <a {$val.onClick} class="{$val.currentstyle}">{$val.name}</a> {/eyou:volist} </div> <!-- 筛选的可选值循环结束 --> </div> {/eyou:volist} <!-- 筛选项栏目循环结束 --> <!-- 清除所有筛选条件按钮 --> <div class="filter-bt"><a href="{$field.resetUrl}">清除筛选条件</a></div> </div> <!-- 隐藏域 --> {$field.hidden} </div> {/eyou:screening}
参数:
id='' 可以任意指定循环里的变量名替代field,假设id='field1',模板调用如:{$field.title} 变成 {$field1.title}
typeid='' 专用于首页筛选,首页调用标签一定要指定栏目ID
currentstyle='' 应用样式class类名
addfields='' 自定义字段名,多个字段之间用英文逗号隔开,比如:addfields='price,spce'
alltxt='' 筛选数值中的第一个自定义选项,该选项是用于重置单条筛选条件,比如:alltxt='全部',alltxt='不限',alltxt='所有'
empty='' 没有数据时显示的文案
底层字段:
请查阅易优Cms官方提供的数据字典,找到表名 ey_channelfield 、ey_article_content
-------------------------------效果展示--------------------------------
1,调用指定栏目文章
模板调用标准代码
{eyou:screening id='field' currentstyle='active' alltxt='全部'} <div class="row"> <div class="filter-box"> {eyou:volist name='$field.list' id='vo'} <div class="filter-boxs"> <div class="filter-tit"> {$vo.title} : </div> <div class="filter-cen"> {eyou:volist name='$vo.dfvalue' id='val'} <a {$val.onClick} class="{$val.currentstyle}">{$val.name}</a> {/eyou:volist} </div> </div> {/eyou:volist} <div class="filter-bt"><a href="{$field.resetUrl}">清除筛选条件</a></div> </div> {$field.hidden} </div> {/eyou:screening}
网站前端显示效果(css样式请自行填充)
【更多示例】
-------------------------------示例1--------------------------------
描述:指定自定义字段读取筛选条件
{eyou:screening id='field' currentstyle='active' addfields='danxuan' alltxt='不限'} <div class="row"> <div class="filter-box"> {eyou:volist name='$field.list' id='vo'} <div class="filter-boxs"> <div class="filter-tit"> {$vo.title} : </div> <div class="filter-cen"> {eyou:volist name='$vo.dfvalue' id='val'} <a {$val.onClick} class="{$val.currentstyle}">{$val.name}</a> {/eyou:volist} </div> </div> {/eyou:volist} <div class="filter-bt"><a href="{$field.resetUrl}">清除筛选条件</a></div> </div> {$field.hidden} </div> {/eyou:screening}
-------------------------------示例2--------------------------------
描述:关闭 “不限” 筛选按钮
{eyou:screening id='field' currentstyle='active' alltxt='off'} <div class="row"> <div class="filter-box"> {eyou:volist name='$field.list' id='vo'} <div class="filter-boxs"> <div class="filter-tit"> {$vo.title} : </div> <div class="filter-cen"> {eyou:volist name='$vo.dfvalue' id='val'} <a {$val.onClick} class="{$val.currentstyle}">{$val.name}</a> {/eyou:volist} </div> </div> {/eyou:volist} <div class="filter-bt"><a href="{$field.resetUrl}">清除筛选条件</a></div> </div> {$field.hidden} </div> {/eyou:screening}