调用指定顶级栏目下的子栏目及子栏目下的内容怎么办?

迅睿框架 更新 2021-11-17 17:03:30 fageseo

我想调用指定顶级栏目下的子栏目及子栏目下的内容

例如:

产品中心

产品中心子栏目1     产品中心子栏目2     产品中心子栏目13   

产品中心子栏目对应内容1   产品中心子栏目对应内容2     产品中心子栏目对应内容3



我想做,当我点击子栏目1的时候出现子栏目1 的内容   当点击子栏目2的时候  出现子栏目2的内容


有大佬指点一下吗?非常感谢,    



方案

  • 云南昆明贰壹网络 #1 · 2021-11-17 02:59:55
    你是要点击出现还是鼠标移动到产品栏目123就出现?
  • diskson #2 · 2021-11-17 08:48:52
    <!-- 指定ID1栏目下的子栏目 -->{category module=share pid=1}{$t.name}{$t.url} <!-- 子栏目的文档 --> {module module=$t.mid catid=$t.id num=10 cache=1 return=t2} {$t2.title}{$t2.url} {/module}{/category}
  • 壹叁网络 #3 · 2021-11-17 09:13:36
    学习一下先
  • 老铁666 #4 · 2021-11-17 09:16:00
    输出当前顶级栏目的下级子栏目{category pid=$top.id return=c}是否当前栏目:{if $c.id==$cat.id} class="active"{/if}<a href="{$c.url}">{$c.name}</a>{/category}多写几层循环可以达到多级调用,点击的效果就是用js实现。pid=$top.id这个是顶级,换成返回的变量.id就是无限下级了。
  • fageseo #5 · 2021-11-17 12:42:50
    云南昆明贰壹网络
    <div class="index_product-body">
    
    			<div class="index_product-tab">
    
    				{category module=share pid=1}
    
    				<a {if $is_first} class="active" {/if}>{$t.name}</a>
    
    				{/category}
    
    			</div>
    
    			<div class="index_product-ul">
    
    				<ul class="active">
    
    				{module module=news catid=1}
    
    					<li>
    
    						<div class="product_img"><img src="{dr_get_file($t['thumb'])}" alt="{$t['title']} "></div>
    
    						<a href="{$t['url']}">{$t['title']} </a>
    
    						<span>MOER+</span>
    
    					</li>
    
    				{/module}
    
    				</ul>
    
                                //如果按照我现在这种就是一个个的写进去,并不是一整套调用出来的
    
                                <ul class="active">
    
    				{module module=news catid=2}
    
    					<li>
    
    						<div class="product_img"><img src="{dr_get_file($t['thumb'])}" alt="{$t['title']} "></div>
    
    						<a href="{$t['url']}">{$t['title']} </a>
    
    						<span>MOER+</span>
    
    					</li>
    
    				{/module}
    
    				</ul>
    
    			</div>
    
    		</div>
    
    
    
    这是我目前写的,但是按照这种方式。无法调用所有的
  • fageseo #6 · 2021-11-17 12:43:16
    老铁666

    <div class="index_product-body">

    <div class="index_product-tab">

    {category module=share pid=1}

    <a {if $is_first} class="active" {/if}>{$t.name}</a>

    {/category}

    </div>

    <div class="index_product-ul">

    <ul class="active">

    {module module=news catid=1}

    <li>

    <div class="product_img"><img src="{dr_get_file($t['thumb'])}" alt="{$t['title']} "></div>

    <a href="{$t['url']}">{$t['title']} </a>

    <span>MOER+</span>

    </li>

    {/module}

    </ul>

    //如果按照我现在这种就是一个个的写进去,并不是一整套调用出来的

    <ul class="active">

    {module module=news catid=2}

    <li>

    <div class="product_img"><img src="{dr_get_file($t['thumb'])}" alt="{$t['title']} "></div>

    <a href="{$t['url']}">{$t['title']} </a>

    <span>MOER+</span>

    </li>

    {/module}

    </ul>

    </div>

    </div>


    这是我目前写的,但是按照这种方式。无法调用所有的

  • 云南昆明贰壹网络 #7 · 2021-11-17 12:58:03
    <div class="index_product-body">
    
    			<div class="index_product-tab">
    
    				{category module=share pid=1}
    
    				<a {if $is_first} class="active" {/if}>{$t.name}</a>
    
    				{/category}
    
    			</div>
    
    			<div class="index_product-ul">
    
    			{category module=share pid=1}
    				<ul class="active">
    
    				{module module=$t.mid catid=$t.id num=10 cache=1 return=t2}
    
    					<li>
    
    						<div class="product_img"><img src="{dr_get_file($t['thumb'])}" alt="{$t2['title']} "></div>
    
    						<a href="{$t2['url']}">{$t2['title']} </a>
    
    						<span>MOER+</span>
    
    					</li>
    
    				{/module}
    
    				</ul>
    
                               {/category}
    
    			</div>
    
    		</div>
    我也不确定对不对, 你试试看。
  • fageseo #8 · 2021-11-17 13:23:24
    云南昆明贰壹网络 这个调不出来内容。。这种我觉得应该有一个判断的。就好像官方给的头调导航调用那样。。但是调用子栏目及当前栏目下的内容列表时的判断。就不知道怎么操作了。
  • 云南昆明贰壹网络 #9 · 2021-11-17 13:32:05
    那你再试试这个,反正我也不咋会,都是乱试的,万一猜对了呢,哈哈
    <div class="index_product-body">
    
    			<div class="index_product-tab">
    
    				{category module=share pid=1}
    
    				<a {if $is_first} class="active" {/if}>{$t.name}</a>
    
    				{/category}
    
    			</div>
    
    			<div class="index_product-ul">
    
    			{category module=share pid=1 return=c}
    				<ul class="active">
    
    				{module module=$c.mid catid=$c.id num=10}
    
    					<li>
    
    						<div class="product_img"><img src=" {dr_thumb($t.thumb, 200, 200)} " alt="{$t2['title']} "></div>
    
    						<a href="{$t.url}">{$t.title} </a>
    
    						<span>MOER+</span>
    
    					</li>
    
    				{/module}
    
    				</ul>
    
                               {/category}
    
    			</div>
    
    		</div>
  • fageseo #10 · 2021-11-17 17:00:06
    云南昆明贰壹网络 这个可以啊。。非常感谢 💓 👍
  • 云南昆明贰壹网络 #11 · 2021-11-17 17:01:58
    满意答案
    看来运气不错,一会儿买个彩票去。 😁 可以的话请给个满意答案哦。fageseo
  • fageseo #12 · 2021-11-17 17:03:30
    @云南昆明贰壹网络:明明是技术高手,既然说要买彩票。

迅睿系统漏洞

站群分站系统
站群分站系统(2026-10-15)
子站域名新增llms.txt访问
GEO系统
GEO系统(2026-10-14)
修复下载zip空白地址问题 修复流量复刻和任务队列错误
GeoSeo收录宝
GeoSeo收录宝(2026-10-14)
新增 站长工具箱 前端首页自动调用meta 数据
滑块验证码 Gocaptcha
滑块验证码 Gocaptcha(2026-10-13)
基于开源项目 go-captcha 的行为验证码插件,滑动拼图、区域...
GeoSeo工具箱
GeoSeo工具箱(2026-10-13)
优化巡检任务
GeoSeo排名助手
GeoSeo排名助手(2026-10-11)
加入大模型自定义
SEO聚合关键字
SEO聚合关键字(2026-10-11)
优化关键字列表页最多支持1万篇文章,过多会导致服务器扛不住;
CMS内容同步复制
CMS内容同步复制(2026-10-10)
增加时间是否更新的开关