织梦副栏目名称和链接调用方法,打开 includeextend.func.php 在最下面加入
if(!function_exists('GetTypeid2')) { function GetTypeid2($typeid2) { global $dsql; $result = ''; $query = "SELECt * FROM `dede_arctype` WHERe id IN($typeid2) AND ishidden<>1 ORDER BY FIELD(id,$typeid2)"; $dsql->Execute('t',$query); while($row = $dsql->GetArray('t')) { $typeurl = GetoneTypeUrlA($row); $result.= ($result=='' ? "{$row['typename']}" : ','."{$row['typename']}"); } return $result; } }
[field:typeid2 function=GetTypeid2(@me)/]
内容页 调用标签写法
{dede:field.typeid2 function=GetTypeid2(@me)/}
首页 调用标签
还需要打开 /include/taglib/arclist.lib.php 找到
if($CrossID=='') $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).')';
改成
if($CrossID=='') $orwheres[] = " (arc.typeid in (".GetSonIds($typeid).") or arc.typeid2 in (".GetSonIds($typeid).") or CONCAt( ',', arc.typeid2, ',' ) LIKE '%,".$typeid.",%' )";
继续找到
else $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).','.$CrossID.')';
改成
else $orwheres[] = " (arc.typeid in (".GetSonIds($typeid).",".$CrossID.") or arc.typeid2 in (".GetSonIds($typeid).",".$CrossID.") or CONCAt( ',', arc.typeid2, ',' ) LIKE '%,".$typeid.",%')";
这样才可以在首页调用副栏目,标签写法是
[field:typeid2 function=GetTypeid2(@me)/]
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)