建筑资源吧 發表於 2022-9-17 10:27:58

X3系列通用:自定义主导航栏目高亮显示的方法

效果如下图:<br /><img title="1.png" id="aimg_16743" aid="16743" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/202209/17/102746w1a4hbh2vz2avba2.png" src="https://www.dismall.com/data/attachment/forum/202209/17/102746w1a4hbh2vz2avba2.png" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" inpost="1" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /><br />打开 header.htm 模板,查找:<br /><ol><li>{if $mnid == $nav}class=&quot;a&quot; {/if}<br /><li></ol>修改为:<br /><ol><li>{if $mnid == $nav || substr($_SERVER['REQUEST_URI'], 1) == str_replace('./', '', $nav)}class=&quot;a&quot; {/if}<br /><li></ol>修改后,更新CSS和模板缓存,只要访问的链接与后台主导航中填写的地址一致,则高亮显示。<br /><br /><br />模板<em>, </em>导航<em>, </em>高亮<em>, </em>显示<em>, </em>效果
頁: [1]
查看完整版本: X3系列通用:自定义主导航栏目高亮显示的方法