Home  >  Article  >  CMS Tutorial  >  How does Dreamweaver tag display the number of articles corresponding to each tag?

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

藏色散人
藏色散人Original
2019-12-03 09:18:442706browse

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)'];

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}

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!

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