HDCMS导航高亮显示!解决办法
生活随笔
收集整理的這篇文章主要介紹了
HDCMS导航高亮显示!解决办法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
第一種方法:(傳遞class)
<channel type='top' row='8' class='cur' ><li class='{$field.class}'><h3><a href='' class="{$field.caturl}">{$field.catname}</a></h3></li> </channel>?
第二種方法:寫公共函數 functions.php
hd / Common / Functions / functions.php
//分類列表獲得PID function allList($pid = 0){if($pid == 0){return false;}$category = M('category')->where(array('cid'=>$pid))->field('cid,pid')->find(); $cate = $category['pid'] ? allList($category['pid']):$category['cid'];return $cate; }循環遍歷:
<channel type='top' row='8'><li class="<?php if($field['cid'] == allList($_GET['cid'])): ?><?php echo 'dlHover' ?><?php endif; ?>"><h3><a href='' class="{$field.caturl}">{$field.catname}</a></h3></li> </channel>使用下來,第二種方法更靈活,適用于二級分類和三級分類;
?
轉載于:https://www.cnblogs.com/e0yu/p/7244119.html
總結
以上是生活随笔為你收集整理的HDCMS导航高亮显示!解决办法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基于互联网大数据的管理创新
- 下一篇: sql 2012先分离迁移mdf mlf