业务经理

微信扫描以上二维码

028-61286886

技术咨询

判断如果在三级栏目下,让其二级三级子类显示出来

开源系统 更新 2020-12-06 12:20:49 奇艺界

模板标签里面


     {list action=category module=share id=1 }

 

   

        <div class="fdh-01-nav-one">

         <h3 {if in_array($catid, $t.catids)}class="sidenavcur"{/if}><a href="{$t.url}">{$t.name}</a></h3>

         

           

          <dl style="display:none;">

            <!-- 2级 -->

            {list action=category module=share pid=$t.id return=t2}

            <dt {if in_array($catid, $t2.catids)}class="sidenavcur"{/if}> <a href="{$t2.url}">{$t2.name}</a></dt>

            

            

            <dd style="display:none;"> 

              <!-- 3级 -->

              {list action=category module=share pid=$t2.id return=t3} 

              <p {if in_array($catid, $t3.catids)}class="sidenavcur"{/if}> <a href="{$t3.url}" >{$t3.name}</a></p>

          {/list} 

            </dd>

             {/list}

          

          </dl>

        </div>

           {/list} 



判断如果在三级栏目下  取消二级 三级的display:none; 属性   让其二级三级子类显示出来

image


判断如果在二级栏目下  取消二级 的display:none; 属性  让其子类显示出来

image

方案

  • POSCMS负责人 #1 · 2020-06-03 16:22:50
    满意答案
     {list action=category module=share id=1 }
     
       
            <div class="fdh-01-nav-one">
             <h3 {if in_array($catid, $t.catids)}class="sidenavcur"{/if}><a target="_blank" href="{$t.url}">{$t.name}</a></h3>
             
               
               {if $t.child}
              <dl>
                <!-- 2级 -->
                {list action=category module=share pid=$t.id return=t2}
                <dt {if in_array($catid, $t2.catids)}class="sidenavcur"{/if}> <a target="_blank" href="{$t2.url}">{$t2.name}</a></dt>
                
                {if $t2.child}
                <dd> 
                  <!-- 3级 -->
                  {list action=category module=share pid=$t2.id return=t3} 
                  <p {if in_array($catid, $t3.catids)}class="sidenavcur"{/if}> <a target="_blank" href="{$t3.url}" >{$t3.name}</a></p>
              {/list} 
                </dd>
                {/if}
                 {/list}
              
              </dl>
              {/if}
            </div>
               {/list}
  • 奇艺界 #2 · 2020-06-03 16:32:55
    POSCMS负责人这样 判断是否有子类 可以 因为 会存在多个二级 所以 不适合 当前子类 谢谢你的回复
  • 奇艺界 #3 · 2020-12-06 12:20:49
    @POSCMS负责人:OK 谢谢OK 谢谢

迅睿系统漏洞

导入微信文章
导入微信文章(2026-09-15)
优化排版缺少文字情况
GEO系统
GEO系统(2026-09-15)
运营客户端,防止误触阴影处关闭对话框
独立站群系统
独立站群系统(2026-09-14)
子站独立部署时修复同步附件失败问题
在线客服
在线客服(2026-09-13)
修复删除会话报错问题 删除会话时联动删除聊天图片
在线考试竞赛系统
在线考试竞赛系统(2026-09-12)
增加投票功能 考试功能拓展 注意:更新后需要执行系统更新,更新数...
网上信箱
网上信箱(2026-09-12)
修复新版本兼容问题
GeoSeo收录宝
GeoSeo收录宝(2026-09-12)
1 优化Update.php文件,解决版本在线升级不完整问题 2 ...
GeoSeo工具箱
GeoSeo工具箱(2026-09-11)
修正历史记录推送
微信系统
微信系统(2026-09-11)
增加数据统计总览界面 账号管理增加服务和公众号的区别 菜单管理支持更...
答题系统
答题系统(2026-09-11)
一站式在线答题系统,支持真题考试、题库练习和错题本,适合培训、考证、...