search
HomeCMS TutorialDEDECMSHow to call tag label and bring link in dedecms system list page

How to call tag label and bring link in dedecms system list page

dedecms system list page how to call the tag tag and bring the link?

The DedeCMS system list page calls the TAG tag and brings the link. I think many webmaster friends want to achieve it. Next, I will introduce the implementation method and code explanation in detail. If you are interested, you can Don’t miss it, I hope it can help you

Recommended learning: 梦Weavercms

Implementation method

Here is the default template as an example, open /templets/default/list_article.htm Found:

The code is as follows:

<small>好评:</small>[field:scores/]

Add the following code after it:

The code is as follows:

<small>标签:</small> 
[field:id runphp=&#39;yes&#39;] 
global $cfg_cmspath; 
$tags = GetTags(@me); 
$revalue = &#39;&#39;; 
$tags = explode(&#39;,&#39;, $tags); 
foreach($tags as $key => $value){ 
if($value){ 
$revalue .= &#39;<a href="&#39;.$cfg_cmspath.&#39;/tags.php?/&#39;.$value.&#39;/">&#39;.$value.&#39;</a> &#39;; 
} 
} 
@me = $revalue; 
[/field:id]

Save Then.

Note: Here I am taking the default template as an example. It is correct to open your own template and add code in the appropriate location.

Code explanation

In fact, only three knowledge points are used here:

1. Use the built-in GetTags function to obtain the TAG list corresponding to the document;

2. Split the obtained value into an array using the half-width comma (,) as the standard;

3. Loop the array elements, output the corresponding value and add a link;

At the same time, for better compatibility, the global $cfg_cmspath; method is also used here to load the program installation directory in the basic system parameters, which is used to automatically install compatible files to the subsystem when additional links

directory site.

Okay, this is the content, and this is the explanation. I hope those who understand can get inspiration from it and draw inferences from one example. Looking forward to sharing your tutorials too. For those who don't understand it, it doesn't matter. You can save this code and learn about it later.

The above is the detailed content of How to call tag label and bring link in dedecms system list page. 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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools