默认下ShopNC的导航是以内容模块作为区分的(虽然也有分类导航,不过只是导航的一部分)比较繁杂,我们这里做一个简单的导航。 演示:http://www.leyant.com/shop/index.php (请用650px高度以上
演示: http://www.leyant.com/shop/index.php
(请用 650px 高度以上的电脑查看,低于 650px 的将隐藏)
1. [代码]隐藏原有的导航
file: home_layout.php <nav class="public-nav-layout" style="display:none">
2. [代码]简易品牌导航
<!-- publicNavLayout Begin --> <div class="nav_simple" style="height: 40px; background-color: #333; color: #eee; line-height: 40px; font-family: '微软雅黑', Arial, sans-serif"> <a href="/" style="color:#eee"><span style="margin-left: 50px; padding-left: 10px; padding-right: 10px; display: inline-block; font-size: 18px">首页</span></a> <?php $model_brand = Model('brand'); $map_brand = array( 'brand_class' => '服饰鞋帽', 'brand_apply' => 1, 'brand_recommend' => 1 ); $rows = $model_brand->where($map_brand)->select(); foreach($rows as $key => $val) { // 处理中英文字符 preg_match_all('/[\x{4E00}-\x{9FBF}]*|[a-zA-Z\s]*/u',trim($val['brand_name']),$data); ?> <a href="/shop/index.php?act=search&op=index&keyword=<?php echo $data[0][1] ?>" style="color:#eee"><span style=" margin-left: 50px; padding-left: 10px; padding-right: 10px; display: inline-block; font-size: 18px" title="<?php echo $data[0][2]?>"><?php echo $data[0][1] ?></span></a> <?php } ?> </div>