在使用dede:likearticle时,如果你想获取多个指定栏目下的相关文章,而刚好这个多个栏目下还有子栏目时,官方的程序不能满足你的需求,你需要改一下
打开 /include/taglib/likearticle.lib.php 找到
1 | if ( !empty($typeid) && !preg_match( '#,#' , $typeid) ) { |
2 | $typeid = GetSonIds($typeid); |
|
在它下面加入:
03 | $typeids = explode( ',' , $typeid); |
04 | foreach($typeids as $ttid) { |
05 | $typeidss[] = GetSonIds($ttid); |
07 | $typeidStr = join ( ',' , $typeidss); |
08 | $typeidss = explode( ',' , $typeidStr); |
09 | $typeidssok = array_unique($typeidss); |
10 | $typeid = join ( ',' , $typeidssok); |
|
模板标签写法
1 | {dede:likearticle row= '10' col= '' titlelen= '150' infolen= '250' mytypeid= '10,12,14' } |
2 | <li><a href= "[field:arcurl/]" >[field:title/]</a></li> |
|
发表评论
评论列表(0条)