單選版效果
單選就是一個(gè)屬性選一次,不能一個(gè)屬性選多次,如需一個(gè)屬性選擇多次,請(qǐng)到繼續(xù)閱讀下面參考。
警告:操作之前先備份你的程序這2個(gè)文件。
/include/arc.listview.class.php
/include/extend.func.php
織夢聯(lián)動(dòng)篩選【單選版】下載(支持手機(jī)版和手機(jī)版跳轉(zhuǎn))
安裝說明
1、根據(jù)自己程序編碼,把下載到的include文件夾里的2個(gè)文件覆蓋到你網(wǎng)站的include文件夾里
2、后臺(tái) - 系統(tǒng) - 系統(tǒng)設(shè)置 - 系統(tǒng)基本參數(shù) - 其他選項(xiàng) - 禁用模板標(biāo)簽 ,把php刪除后保存。
3、后臺(tái) - 核心 - 頻道模型 - 內(nèi)容模型管理
找到您要設(shè)置篩選的模型,這里以“普通文章”為例,點(diǎn)擊右邊的編輯按鈕,在出來的頁面中切換到“字段管理”,
點(diǎn)擊“添加新字段”,填寫的時(shí)候注意"數(shù)據(jù)類型"選擇【使用option下拉框】
字段名稱盡量使用純英文,不加符號(hào)和數(shù)字,不要出現(xiàn)跟過濾函數(shù)有同樣字母的,避免沖突
默認(rèn)值盡量不要使用符號(hào)
模板標(biāo)簽調(diào)用說明
1) 在列表頁模板需要顯示篩選的地方加入(手機(jī)版也一樣)
{dede:php}AddFilter(模型ID,類型,"字段1");{/dede:php}
例:
{dede:php}AddFilter(1,1,"area");{/dede:php}
1-1、模型ID在哪里看?
后臺(tái) - 核心 - 頻道模型 - 內(nèi)容模型管理
類型
1代表文字類型,例如
2代表下拉類型,例如
3代表單選類型,例如
多個(gè)字段同時(shí)輸出的寫法
{dede:php}AddFilter(模型ID,類型,"字段1,字段2,字段3");{/dede:php}
{dede:php}AddFilter(1,1,"area,type,time,status");{/dede:php}
"area,type,time,status" 是指定的字段名,多個(gè)字段用半角逗號(hào)分隔。
首頁調(diào)用方法
{dede:php}AddFilter(模型ID,類型,"字段1","欄目id");{/dede:php}
內(nèi)容頁調(diào)用方法
{dede:php}AddFilter(模型ID,類型,"字段1","欄目id",1);{/dede:php}
篩選結(jié)果數(shù)據(jù)顯示只支持在列表頁使用,在列表標(biāo)簽dede:list下顯示篩選結(jié)果
{dede:list pagesize='10'}
[field:title/]
{/dede:list}
輸出的樣式修改在 include/extend.func.php
頁面title標(biāo)題添加篩選文字說明
<title>{dede:field.area/} - {dede:field.type/} - {dede:field.time/} - {dede:field.title/} - {dede:global.cfg_webname/}</title>
<meta name="keywords" content="{dede:field.keywords/}"/>
<meta name="description" content="{dede:field.description function=html2text(@me)/}"/>
{dede:field.arear/} - {dede:field.type/} - {dede:field.time/} 直接用你的篩選字段即可。
手機(jī)站自動(dòng)跳轉(zhuǎn)到對(duì)應(yīng)手機(jī)站篩選說明
在電腦站列表模板中跳轉(zhuǎn)到移動(dòng)設(shè)備代碼中的
{dede:global.cfg_mobileurl/}/list.php?tid={dede:field.id/}
在它后面加入
{dede:global.cfg_mobileurl/}/list.php?tid={dede:field.id/}&area={dede:field.area/}&type={dede:field.type/}&time={dede:field.time/}
例如
<meta http-equiv="mobile-agent" content="format=xhtml;url={dede:global.cfg_mobileurl/}/list.php?tid={dede:field.id/}">
<script type="text/javascript">if(window.location.toString().indexOf('pref=padindex') != -1){}else{if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){if(window.location.href.indexOf("?mobile")<0){try{if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){window.location.href="{dede:global.cfg_mobileurl/}/list.php?tid={dede:field.id/}";}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}}}</script>
改成
<meta http-equiv="mobile-agent" content="format=xhtml;url={dede:global.cfg_mobileurl/}/list.php?tid={dede:field.id/}&area={dede:field.area/}&type={dede:field.type/}&time={dede:field.time/}">
<script type="text/javascript">if(window.location.toString().indexOf('pref=padindex') != -1){}else{if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){if(window.location.href.indexOf("?mobile")<0){try{if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){window.location.href="{dede:global.cfg_mobileurl/}/list.php?tid={dede:field.id/}&area={dede:field.area/}&type={dede:field.type/}&time={dede:field.time/}";}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}}}</script>
單選版完成。
 
多選版效果
多選就是一個(gè)屬性選多次,如需一個(gè)屬性選擇一次,參考最上面單選版
警告:操作之前先備份你的程序這2個(gè)文件。
/include/arc.listview.class.php
/include/extend.func.php
織夢聯(lián)動(dòng)篩選【多選版】下載
安裝說明
1、根據(jù)自己程序編碼,把下載到的include文件夾里的2個(gè)文件覆蓋到你網(wǎng)站的include文件夾里
2、后臺(tái) - 系統(tǒng) - 系統(tǒng)設(shè)置 - 系統(tǒng)基本參數(shù) - 其他選項(xiàng) - 禁用模板標(biāo)簽 ,把php刪除后保存。
3、后臺(tái) - 核心 - 頻道模型 - 內(nèi)容模型管理
找到您要設(shè)置篩選的模型,這里以“普通文章”為例,點(diǎn)擊右邊的編輯按鈕,在出來的頁面中切換到“字段管理”,
點(diǎn)擊“添加新字段”,填寫的時(shí)候注意"數(shù)據(jù)類型"選擇【使用Checkbox多選框】
字段名稱盡量使用純英文,不加符號(hào)和數(shù)字,不要出現(xiàn)跟過濾函數(shù)有同樣字母的,避免沖突
默認(rèn)值盡量不要使用符號(hào)
模板標(biāo)簽調(diào)用說明
1) 在列表頁模板需要顯示篩選的地方加入
{dede:php}AddFilter(模型ID,類型,"字段1");{/dede:php}
例:
{dede:php}AddFilter(1,1,"area");{/dede:php}
1-1、模型ID在哪里看?
后臺(tái) - 核心 - 頻道模型 - 內(nèi)容模型管理
類型
1代表文字類型,例如
2代表單選類型,例如
多個(gè)字段同時(shí)輸出的寫法
{dede:php}AddFilter(模型ID,類型,"字段1,字段2,字段3");{/dede:php}
{dede:php}AddFilter(1,1,"area,type,time,status");{/dede:php}
"area,type,time,status" 是指定的字段名,多個(gè)字段用半角逗號(hào)分隔。
首頁調(diào)用方法
{dede:php}AddFilter(模型ID,類型,"字段1","欄目id");{/dede:php}
內(nèi)容頁調(diào)用方法
{dede:php}AddFilter(模型ID,類型,"字段1","欄目id",1);{/dede:php}
篩選結(jié)果數(shù)據(jù)顯示只支持在列表頁使用,在列表標(biāo)簽dede:list下顯示篩選結(jié)果
{dede:list pagesize='10'}
[field:title/]
{/dede:list}
輸出的樣式修改在 include/extend.func.php
頁面title標(biāo)題添加篩選文字說明
<title>{dede:field.area/} - {dede:field.type/} - {dede:field.time/} - {dede:field.title/} - {dede:global.cfg_webname/}</title>
<meta name="keywords" content="{dede:field.keywords/}"/>
<meta name="description" content="{dede:field.description function=html2text(@me)/}"/>
{dede:field.arear/} - {dede:field.type/} - {dede:field.time/} 直接用你的篩選字段即可。
大功告成。兩個(gè)版本根據(jù)需求去修改