dedecms列表页通过runphp调用tag的代码:
[field:id runphp=’yes’]
global $cfg_cmspath;
$tags = GetTags(@me);
$revalue = ”;
$tags = explode(‘,’, $tags);
foreach($tags as $key => $value){
if($value){
$revalue .= '<a href="'.$cfg_cmspath.'/tags.php?/'.$value.'/">'.$value.'</a> ';
}
}
@me = $revalue;
[/field:id]
举例说明:
{dede:list pagesize='50'}
<li>
<a href="https://www.360muye.cn/[field:arcurl /]" title="[field:title function='htmlspecialchars(@me)'/]"
target=_blank>[field:title function="cn_substr(@me,48)"/]</a>
<p>标签:[field:id runphp=’yes’]
global $cfg_cmspath;
$tags = GetTags(@me);
$revalue = ”;
$tags = explode(‘,’, $tags);
foreach($tags as $key => $value){
if($value){
$revalue .= '<a href=”'.$cfg_cmspath.’/tags.php?/’.$value.’/”>’.$value.'</a>';
}
}
@me = $revalue;
[/field:id]</p>
</li>
{/dede:list}