dedecms dede:arclist 怎么调用文章副栏目的名称,我是要文章副栏目的名称和该栏目的链接
{dede:channel row='20' type ='son' typeid ='2' } 此处是底层标签 {/dede:channel}
row='20'表示调用20个栏目名称
type ='son'表示调用下级栏目
typeid ='2'表示父栏目id为2
关于底层标签,诸如栏目名称,链接等等就不再赘述了吧
{dede:channelartlistrow='5' typeid='14,22,30,40,49'}
<li>
<a href="">{dede:fieldname='typeurl'/} <img src="{dede:globalcfg_templets_skin/}/images/0{dede:globalitemindex/}jpg" alt="{dede:fieldname='typename'/}" width="243" height="120" />
<div class="te-s">
<h3>{dede:fieldname='typename'/}</h3>
<p>
{dede:arclist
titlelen='120' row='8'}
<a
href="[field:arcurl /]" title="[field:title/]"
target="_blank" >[field:title/]</a>
{/dede:arclist}
</p>
</div>
</a>
</li>
{/dede:channelartlist}
内容页 -标签:
{dede:fieldtypeid2 runphp='yes'}
$dsql= new dedesql();
$ks = split(',', @me);
$type2name="";
foreach($ks as $k){
$k = trim($k);
if ($k!="") {
if ($row = $dsql->getOne("select ,ID as id1 from dede_arctype where id="$k)){
$type_path=GetTypeUrl($row['id1'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);
$type2name="<a href='"$type_path"' target=_blank>"$row['typename']"</a> ";
}
}
}
@me=substr($type2name,0,strlen($type2name)-1);
{/dede:fieldtypeid2}
首页 列表页 -标签 :
[field:typeid2 runphp='yes']
$dsql= new dedesql();
$ks = split(',', @me);
$type2name="";
foreach($ks as $k){
$k = trim($k);
if ($k!="") {
if ($row = $dsql->getOne("select ,ID as id1 from dede_arctype where id="$k)){
$type_path=GetTypeUrl($row['id1'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);
$type2name="<a href='"$type_path"' target=_blank>"$row['typename']"</a> ";
}
}
}
@me=substr($type2name,0,strlen($type2name)-1);
[/field:typeid2]
channelArtlist 是唯一一个可以直接嵌套其它标记的标记,不过仅限于嵌套
{dede:type}{/dede:type} 和 {dede:arclist}{/dede:arclist} 两个标记
你嵌套了 {dede:channel}所以有问题
调用多级子栏目讲参考:http://hibaiducom/kfs920/item/58aaec4c6e1d76e3dd0f6c37
同时调用一级、二级、三级以至N级栏目的方法:http://hibaiducom/kfs920/item/80ac8871ebe3c2236cc37c38
0条评论