联系官方销售客服

1835022288

028-61286886

应用插件 版主:官方插件技术组
如何 调用多个指定父栏目下的子栏目
类型:迅睿CMS 更新时间:2022-04-10 09:28:29 内容系统
插件 内容建站系统 V3.9
应用作者 迅睿官方团队
发布时间 2022-03-01 15:30:06
更新时间 2024-04-03 09:44:20


如何 调用多个指定父栏目下的子栏目

{category module=share pid=0 id=3,9,10 num=3 return=t1}
 <div class="fdh-01-nav-one">
  <h3 {if IS_SHARE && $catid && dr_in_array($catid, $t.catids)} class="sidenavcur" {/if}><a href="{$t1.url}" title="{$t1.name}"> {$t1.name} </a></h3>
  <dl style="display:none;">
  <!-- 2级 -->
  {if $t1.child}
  {category module=share pid=$t1.[id=3,6,9] return=t2 num=10}
  <dt {if IS_SHARE && $catid && dr_in_array($catid, $t2.catids)} class="sidenavcur"{/if}>
  <a href="{$t2.url}" title="{$t2.name}"> {$t2.name} </a>
  </dt>
  {/category}
  {/if}
  </dl>
 </div>
{/category}

这样写调用不出来子栏目?哪里错误,应该怎么写呢?

插件教程:https://www.xunruicms.com/doc/app-928.html

回帖
  • 张大山
    #1楼    张大山
    2022-04-09 20:50:34
    Chrome 0
    {category module=share pid=3 num=3 return=t1}
  • guoguo123
    #2楼    guoguo123
    2022-04-10 08:23:09
    Chrome 0
    张大山 我是想先循环 id为 3,9,10 三个顶级栏目,再循环3,9,10下的子栏目
  • LandQ
    #3楼    LandQ
    2022-04-10 09:14:06
    Chrome 0
    guoguo123
    {category module=share id=3,9,10 }
    <div class="fdh-01-nav-one">
        <h3 {if IS_SHARE && $catid && dr_in_array($catid, $t.catids)} class="sidenavcur" {/if}><a href="{$t1.url}" title="{$t1.name}"> {$t1.name} </a></h3>
        <dl style="display:none;">
            <!-- 2级 -->
            {if $t1.child}
            {category module=share pid=$t.id num=10 return=t2}
            <dt {if IS_SHARE && $catid && dr_in_array($catid, $t2.catids)} class="sidenavcur"{/if}>
            <a href="{$t2.url}" title="{$t2.name}"> {$t2.name} </a>
            </dt>
            {/category}
            {/if}
        </dl>
    </div>
    {/category}
  • LandQ
    #4楼    LandQ
    2022-04-10 09:17:12
    Chrome 0
    更正上面代码
    {category module=share id=3,9,10 }
    <div class="fdh-01-nav-one">
        <h3 {if IS_SHARE && $catid && dr_in_array($catid, $t.catids)} class="sidenavcur" {/if}><a href="{$t.url}" title="{$t.name}"> {$t.name} </a></h3>
        <dl style="display:none;">
            <!-- 2级 -->
            {if $t1.child}
            {category module=share pid=$t.id num=10 return=t2}
            <dt {if IS_SHARE && $catid && dr_in_array($catid, $t2.catids)} class="sidenavcur"{/if}>
            <a href="{$t2.url}" title="{$t2.name}"> {$t2.name} </a>
            </dt>
            {/category}
            {/if}
        </dl>
    </div>
    {/category}
    满意答案
  • guoguo123
    #5楼    guoguo123
    2022-04-10 09:28:29
    Chrome 0
    @LandQ:已解决!thank you