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='yes'] global $cfg_cmspath; $tags = GetTags(@me); $revalue = ''; $tags = explode(',', $tags); foreach($tags as $key => $value){ if($value){ $revalue .= '<a href="'.$cfg_cmspath.'/tags.php?/'.$value.'/">'.$value.'</a> '; } } @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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Atom editor mac version download
The most popular open source editor

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
Useful JavaScript development tools