Home  >  Article  >  CMS Tutorial  >  How to call the current article Tag tag on the dedecms article page and add a Tag hyperlink

How to call the current article Tag tag on the dedecms article page and add a Tag hyperlink

藏色散人
藏色散人Original
2020-01-08 09:36:121529browse

How to call the current article Tag tag on the dedecms article page and add a Tag hyperlink

dedecms article page How to call the current article Tag tag and add a Tag hyperlink?

dedecms article page calls the current article Tag tag and adds a Tag hyperlink

Recommended learning: 梦Weavercms

I have read many articles It seems that there are some problems with their quotation marks in the article, so I rearranged it and posted it:

1. Current article tag

It is relatively simple to call the Tag tag on the article page of Dream Weaver dedecms. Find the article template. Just add the tag {dede:field.tags/}. However, the default Tag tag of dedecms has no link, so proceed to the second step.

2. Add a hyperlink to the Tag

We found /include/helpers/archive.helper.php in the website and directory, and found about 120 lines.

if ( ! function_exists('GetTags'))
{
    function GetTags($aid)
    {
        global $dsql;
        $tags = '';
        $query = "SELECT tag FROM `dede_taglist` WHERE aid='$aid' ";
        $dsql->Execute('tag',$query);
        while($row = $dsql->GetArray('tag'))
        {
            $tags .= ($tags=='' ? $row['tag'] : ','.$row['tag']);
        }
        return $tags;
    }
}

Replace with the following code:

if ( ! function_exists('GetTags'))
{
    function GetTags($aid)
    {
        global $dsql;
        $tags = '';
        $query = "SELECT tag FROM `dede_taglist` WHERE aid='$aid' ";
        $dsql->Execute('tag',$query);
        while($row = $dsql->GetArray('tag'))
        {
            $tags .= ($tags=='' ? ''.$row['tag'].'': ','.'
'.$row['tag'].'');        }
        return $tags;
    }}

Or download the file directly and replace

The above is the detailed content of How to call the current article Tag tag on the dedecms article page and add a Tag hyperlink. 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