Home > CMS Tutorial > DEDECMS > body text

How does Dreamweaver tag display the number of articles corresponding to each tag?

藏色散人
Release: 2019-12-03 09:18:44
Original
2743 people have browsed it

How does Dreamweaver tag display the number of articles corresponding to each tag?

How to display the number of articles corresponding to each tag in the DreamWeaver tag?

Dreamweaver tag displays the number of articles corresponding to each tag

Recommended learning: Dreamweaver cms

Sometimes we want to achieve something similar For tags like WordPress, while displaying the link and tag name of the tag, it can also display the number of articles associated with each tag. As shown in the figure below:

This requires modifying the file /include/taglib/tag.lib.php and finding "$row['link'] = $cfg_cmsurl."/tags around line 87. php?/".urlencode($row['keyword'])."/";'

Add the following code below this line:

$count = $dsql->GetOne("Select count(tid) From `dede_taglist` where tag = '".$row['tag']."'");
$row['count'] = $count['count(tid)'];
Copy after login

After adding it, you can pass [ field:count/] to get the number of articles associated with the current tag tag, for example:

      {dede:tag sort='hot' getall='2'}  
        <li><a title="[field:count/]个话题" href="[field:link/]">[field:tag /]</a></li>
        {/dede:tag}
Copy after login

The above is the detailed content of How does Dreamweaver tag display the number of articles corresponding to each tag?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!