search
HomeCMS TutorialDEDECMSHow 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

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==&#39;&#39; ? &#39;<a href=/tags.php?/&#39;.$row[&#39;tag&#39;].&#39; target=_blank>&#39;.$row[&#39;tag&#39;].&#39;</a>&#39;: &#39;,&#39;.&#39;
<a href=/tags.php?/&#39;.$row[&#39;tag&#39;].&#39; target=_blank>&#39;.$row[&#39;tag&#39;].&#39;</a>&#39;);        }
        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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool