太阳成游戏网站

联系官方销售客服

QQ1835022299

028-61286886

应用插件 版主:官方插件技术组
这是正常的有二级的显示二级没有二级的则输出想改造下判断三级因
类型:太阳成游戏网站CMS 更新时间:2020-09-16 14:46:55 category module
模板标签里面

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

  {if $t.child}

 

  • {$t.name}

       

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

           

    • {$t2.name}
    •       {/list}

         

     

  •   {else}

     

  • {$t.name}
  •   {/if}

      {/list}



    这是正常的:有 二级的显示二级  没有 二级的则输出:

  • {$t.name}



  • 想改造下判断三级:因为二级有 二种样式有三级的一种样式  没三级的一种样式


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

      {if $t.child}

     

  • {$t.name}

       

      --有三级开始--

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

           

    • {$t2.name}

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

        {$t3.name}

         {/list}

    •       {/list}

         



    --有三级结束--


    ---只有 二级开始---

     

  • {$t.name}

       

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

           

    • {$t2.name}
    •       {/list}

         

     


  • ---只有 二级结束--

     

      {else}

    ----只有一级开始--

     

  • {$t.name}
  • ----只有一级结束--

      {/if}

      {/list}







    回帖
    • 靠悬赏赚钱买授权
      #1楼    靠悬赏赚钱买授权
      2020-09-16 14:25:31
      Chrome 0
      赏一块钱呗,老哥,我会写
    • 奇艺界
      #2楼    奇艺界
      2020-09-16 14:26:44
      Chrome 0
      增加悬赏(设置悬赏)金:1元,希望大家给予帮助!
    • 奇艺界
      #3楼    奇艺界
      2020-09-16 14:27:07
      Chrome 0
      靠悬赏(设置悬赏)赚钱买授权 谢谢
    • 胡金海
      #4楼    胡金海
      2020-09-16 14:35:25
      Chrome 0
      其实这个原理很简单,就是根据child字段来判断
    • 奇艺界
      #5楼    奇艺界
      2020-09-16 14:36:02
      Chrome 0
      胡金海 可以 给 改造下吗
    • 靠悬赏赚钱买授权
      #6楼    靠悬赏赚钱买授权
      2020-09-16 14:38:54
      Chrome 0
      {list action=category module=share pid=0}
      
      {if $t.child}
      
      
    • {$t.name}
        {list action=category module=share pid=$t.id return=t2} {if $t2.child}
      • {$t2.name}
          {list action=category module=share pid=$t2.id return=t3}
        • {$t3.name}
        • {/list}
      • {else}
      • {$t2.name}
      • {/if} {/list}
    • {else}
    • {$t.name}
    • {/if} {/list}
      四楼已经懂了精髓
      满意答案
    • 奇艺界
      #7楼    奇艺界
      2020-09-16 14:46:55
      Chrome 0
      @靠悬赏(设置悬赏)赚钱买授权:谢谢 十分感谢