GetAll = 0 Call Current page tag
GetAll = 1 Call the tag tag of the whole station
Example
Current article
| The code is as follows |
Copy Code |
{dede:tag sort= ' new ' getall= ' 0′}<a href= ' [field:link/] ' >[field:tag/]</a>{/dede:tag} |
Call Full Station
| The code is as follows |
Copy Code |
{dede:tag sort= ' new ' getall= ' ′}<a href= ' [field:link/] ' >[field:tag/]</a>{/dede:tag} |
If I want to have a label to come out tags tags: a,b,c So, this dedecms is not an example, the following see I modify the method.
Locate the channelunit.func.php file in the Include directory, plus
| The code is as follows |
Copy Code |
function Getarttag ($id) { $tags = '; $id = Intval ($id); $dsql = new Dedesql (false); $sql = "SELECT ' Tag ' from #@__taglist where aid= ' $id '"; $dsql->setquery ($sql); $dsql->execute (' HW '); while ($row = $dsql->getarray (' HW ')) { if ($tags = = "") { $tags = ' tag tag: <a href= '/tags/'. UrlEncode ($row [' tag ']). ' /">". $row [' tag ']. ' </a> '; } Else { $tags. = ', <a href= '/tags/'. UrlEncode ($row [' tag ']). ' /">". $row [' tag ']. ' </a> '; } } return $tags; } |
And then find your site template file on the page plus
| The code is as follows |
Copy Code |
{Dede:field.aid function= "Getarttag (@me)"/} |
So that makes the call OH. Original site reprinted annotated source http://www.111cn.net otherwise must investigate