DedeCms織夢一二級導航菜單被點擊頂級欄目高亮織
導讀:織夢技巧織夢技巧織夢一二級導航菜單被點擊的欄目高亮顯示方法詳解,廢話不多說直接舉例說明: 織夢一級菜單被點擊欄目高亮調用方法: HTML {dede:channel typeiseo網站排名優化軟件網站推廣優化seo。
織夢一二級導航菜單被點擊的欄目高亮顯示方法詳解,廢話不多說直接舉例說明: 織夢一級菜單被點擊欄目高亮調用方法: HTML {dede:channel typeid =1 type =son currentstyle= li class = on a href = ~typelink~ […]
第一步:因為織夢默認dede:channelartlist標簽是不支持currentstyle屬性的,所以接加下先修改channelartlist.lib.php
1:打開include aglibchannelart網站建設教程list.lib.php,找到
PHP $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]); 替換成 PHP $pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]); if($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] ){ $pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'navOn'; } else{ $pv->Fields['currentstyle'] = ''; }第二步:前臺調用:
HTML {dede:channelartlist typeid='top' currentstyle='on' } <li><a class="{dede:field.currentstyle/}" href="{dede:field name='none'/}" >{dede:field name='typename'/}</a> <ul>{dede:channel type='son' noself='yes'} <li><a href="[field:typelink/]" >[field:typename/]</a></li> {/dede:channel} </ul> <網站seo優化診斷工具/li> {/dede:channelartlist} *注:生成欄目,循環出的頂級欄目li會有一個class=“on”的屬性。頁面效果如圖所示:相關seo網站排名優化軟件網站推廣優化seo。聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-25 ,文章DedeCms織夢一二級導航菜單被點擊頂級欄目高亮織主要講述菜單,標簽,織夢網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_8245.html