Fields['tags']){} ”; then call the template."/> Fields['tags']){} ”; then call the template.">

Home  >  Article  >  CMS Tutorial  >  How to call the current column TAG tag in DEDECMS

How to call the current column TAG tag in DEDECMS

藏色散人
藏色散人Original
2020-01-09 09:34:492499browse

How to call the current column TAG tag in DEDECMS

How does DEDECMS call the TAG tag of the current column?

DEDECMS calls the TAG tag of the current column

Recommended learning : 梦Weavercms

Recently, the editor of Xinke was checking the issue of Dreamweaver tag, and happened to find the following content. I found it useful, so I left it here.

After working for a long time, I finally figured out how to make DEDE's TAG tags display by column, and only display all tags in the current column: D

1. Open tag.lib.php in the include/taglib/ directory File

Find the following code and insert the marked part of the code

if($getall==0 && isset($refObj->Fields['tags']) && !empty($refObj->Fields['aid']))  
{  
        $dsql->SetQuery("Select tid From `ddmx_taglist` where aid = '{$refObj->Fields['aid']}' ");  
        $dsql->Execute();  
        $ids = '';  
        while($row = $dsql->GetArray())  
  {  
          $ids .= ( $ids=='' ? $row['tid'] : ','.$row['tid'] );  
        }  
        if($ids != '')  
        {  
                $addsql = " where id in($ids) ";  
        }  
        if($addsql=='') return '';  
}  
  
else if($getall==2)  
{  
$addsql = " where typeid='{$refObj->Fields['typeid']}' ";  
}  
else  
{  
        if(!empty($typeid))  
        {  
                $addsql = " where typeid='$typeid' ";  
        }

2. Modify your template

The template call is as follows:

{dede:tag sort='hot' getall='2'}  
<a href=&#39;[field:link/]&#39;>[field:tag /]</a>  
{/dede:tag}

Done

The above is the detailed content of How to call the current column TAG tag in DEDECMS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn