The realization method of displaying the corresponding number of articles in each tag by Dream Weaving tag
This article mainly introduces the realization method of weaving dream tag to display the corresponding number of articles in each tag, which has a certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
How does Dream Weaving tag display the corresponding number of articles for each tag?
Dream Weaving tag displays the corresponding number of articles for each tag
Recommended study: dream weaving cms
Sometimes we want to implement a tag like wordpress, which displays the link and tagname of the tag as well as the number of articles associated with each tag. As shown in the following figure:
You need to modify the / include/taglib/tag.lib.php file to find the "$row ['link'] = $cfg_cmsurl." / tags.php?/ ".urlencode ($row [' keyword'])." / ";'in line 87 or so.
Add the following code at the bottom of this line:
$count = $dsql- > GetOne ("Select count (tid) From `dede_ taglist`where tag ='". $row ['tag']. "'"); $row ['count'] = $count [' count (tid)']
After you add it, you can use [field:count/] to obtain the number of articles associated with the current tag tag, for example:
{dede:tag sort='hot' getall='2'} [field:tag /] {/ dede:tag} Thank you for reading this article carefully. I hope it is helpful for everyone to share the realization method of Weaving Dream tag to show the corresponding number of articles in each tag. At the same time, I also hope you can support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!