业务经理

微信扫描以上二维码

028-61286886

技术咨询

这个判断没生效呢目的是判断有无三级栏目有三级输出上面的样式没

迅睿框架 更新 2020-12-06 12:10:04 奇艺界

{list action=category module=share num=6 pid=0}

<li id="menu-10157-1" class="{if $catid && in_array($catid, $t.catids)}active-trail{/if} middle even sf-item-2 sf-depth-1 sf-total-children-12 sf-parent-children-5 sf-single-children-7 menuparent"> <a href="{$t.name}" class="sf-depth-1 menuparent">{$t.name}</a> {if $t.child}

  <ul>

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

    

    

    {if $t2.child}

    <li id="menu-11737-1" class="middle even sf-item-2 sf-depth-2 sf-total-children-6 sf-parent-children-0 sf-single-children-6 menuparent"> <a href="{$t2.url}" class="sf-depth-2 menuparent">{$t2.name}</a>

      <ul>

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

        <li id="menu-10161-1" class="first odd sf-item-1 sf-depth-3 sf-no-children"><a href="{$t3.url}" class="sf-depth-3">{$t3.name}</a></li>

        {/list}

      </ul>

    </li>

    {else}

    

    

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

    <li id="menu-10178-1" class="first odd sf-item-1 sf-depth-2 sf-no-children"><a href="{$t2.url}" class="sf-depth-2">{$t2.name}</a></li>

    {/list}

    

    

    

    {/if} 

    

    

    

    {/list}

  </ul>

  {/if} </li>

{/list}



{xunruicms_img_title}


这个 判断 没生效呢  :目的是判断 有无三级栏目  有三级 输出上面的 样式  没有 三级 输出下面的 样式:



目前是{xunruicms_img_title}

反复循环了  谢谢


方案

  • 迅睿框架创始人 #1 · 2020-10-20 10:04:56
    我最不喜欢看这种循环层级太多的循环了,一看着头就大了
  • 二开/定制/使用解答专家 #2 · 2020-10-20 10:08:09
    满意答案

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

    <li id="menu-10178-1" class="first odd sf-item-1 sf-depth-2 sf-no-children"><a target="_blank" href="{$t2.url}" class="sf-depth-2">{$t2.name}</a></li>

    {/list}改成 <li id="menu-10178-1" class="first odd sf-item-1 sf-depth-2 sf-no-children"><a target="_blank" href="{$t2.url}" class="sf-depth-2">{$t2.name}</a></li>
    官方默认模板有现成的写法,可以借鉴

  • 奇艺界 #3 · 2020-12-06 12:10:04
    @二开/定制/使用解答专家:OK谢谢OK谢谢

迅睿系统漏洞

无忧ai客服
无忧ai客服(2026-11-10)
1 新增「联系卡片」功能和隔时间自动弹出功能,前端第一次打开客服图标...
用户系统
用户系统(2026-11-10)
template方法去掉where的get参数值
多网站系统
多网站系统(2026-11-10)
在站点列表旁边增加站点权限设置 增加翻译设置,多站点选择不同语言时进...
下载Plus
下载Plus(2026-11-09)
新增功能** - 内容总下载统计:可为各内容模块一键安装统计字...
系统安全加固
系统安全加固(2026-11-09)
更新木马识别库 木马扫描改为分步收集文件 安全检测扩展至 19 项:...
内容维护工具
内容维护工具(2026-11-08)
增加数据库备份 增加内容图片压缩 模块内容列表显示主表条数 全模块替...
外贸多语言建站
外贸多语言建站(2026-11-07)
新增通用字符替换规则
水滴AI自动发文
水滴AI自动发文(2026-11-06)
修复了缓存配置
可视化表单
可视化表单(2026-11-06)
提交记录改为按表单查看:未选表单时先进入选择页 选中后列表展示该表单...