phpcmsV9调用顶级父栏目的所有子栏目 - 调用总结
1. 都有哪些调用场景?
列表页
内容页
子栏目首页
2. 效果图:
3. 方法代码如下:
<article>
<h1 class="t_nav">
<a href="{siteurl($siteid)}" class="n1">网站首页</a>
{if $top_parentid}
{pc:content action="category" catid="$top_parentid" num="15" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
<a href="{$r[url]}" class="n2">{$r[catname]}</a>
{/loop}
{/pc}
<a href="" class="n2">留言</a>
{if $modelid}
<a href="{APP_PATH}index.php?m=content&c=search&catid={$catid}" class="n2">搜索</a>
{/if}
{/if}
</h1>
<p style="padding-bottom: 10px;"><span>您现在的位置是:<a href="{siteurl($siteid)}">首页</a> >{catpos($catid)}正文</span></p>
<div>
<iframe id="iframe" name="main" src="http://www.cxtuku.com/" frameborder="0" style="min-height:600px;width:100%;height:100%;"></iframe>
</div>
</article>
4. 总结
通过{if $top_parentid}
判断是否有父级,然后输出条件为真的所有子栏目。
以上就是关于“ phpcmsV9调用顶级父栏目的所有子栏目 - 调用总结 ” 的全部内容。