1. Call all the tag methods on this site.
This official notes
Method 1:
The code is as follows: |
Copy code |
{Dede: tag type = 'current '/} |
After generation: tag tags (number of tags)
Method 2:
The code is as follows: |
Copy code |
{Dede: tag sort = 'new' getall = '0' row = 60} <A target = "_ blank" href = '[field: link/]'> [field: tag/] </a> {/Dede: tag} |
Supplement:
The code is as follows: |
Copy code |
Latest tag {Dede: tag row = '30' sort = 'new'} [field: tag/] {/dede: tag} Popular tags for current month {Dede: tag row = '30' sort = 'month'} [field: tag/] {/dede: tag} Random tag {Dede: tag row = '60' sort = 'Rand'} [field: tag/] {/dede: tag} |
Note:
Row: number of calls.
Sort: sorting method. Parameters include month, rand, week, and new.
Getall: Get type. Parameters: 0 and 1. 0 indicates the current content page or topic page tag, and 1 indicates obtaining the full site tag.
2. Call the tag of the current page of the article
Add the {dede: field. tags/} Tag to the article template, but the default Tag of dedecms is not linked.
Add a hyperlink to a Tag
Find http://www.111cn.net/include/helpers/archive.helper.php under the website and directory, and find rows in the left-right corner.
The code is as follows: |
Copy code |
If (! Function_exists ('gettags ')) { Function GetTags ($ aid) { Global $ dsql; $ Tags = ''; $ Query = "SELECT tag FROM 'dede _ taglist' WHERE aid = '$ aid '"; $ Dsql-> Execute ('tag', $ query ); While ($ row = $ dsql-> GetArray ('tag ')) { $ Tags. = ($ tags = ''? $ Row ['tag']: ','. $ row ['tag']); } Return $ tags; } } Replace it with the following code: If (! Function_exists ('gettags ')) { Function GetTags ($ aid) { Global $ dsql; $ Tags = ''; $ Query = "SELECT tag FROM 'dede _ taglist' WHERE aid = '$ aid '"; $ Dsql-> Execute ('tag', $ query ); While ($ row = $ dsql-> GetArray ('tag ')) { $ Tags. = ($ tags = ''? '<A href =/tags. php? /'. $ Row ['tag']. 'Target = _ blank>'. $ row ['tag']. '</a> ':','.' <A href =/tags. php? /'. $ Row ['tag']. 'Target = _ blank>'. $ row ['tag']. '</a> ');} Return $ tags; }} |
3. Call the tag label method of this topic
Open the DEDECMS root directory include/common. func. php
At the bottom?> Add the following code:
The code is as follows: |
Copy code |
Function listtag ($ aid) { $ Tsql = new DedeSql (false ); $ Tags = ''; $ Tsql-> SetQuery ("Select I. tag From dede_taglist t left join dede_tagindex I on I. id = t. tid where t. aid = '$ aid '"); $ Tsql-> Execute ('t '); While ($ row = $ tsql-> GetArray ('t', MYSQL_ASSOC )){ $ Tags. = "<a href = '/tags. php? /". Urlencode ($ row ['tag'])."/'> ". $ row ['tag']." </a> "; } Return $ tags; }
2. You can use 21 on the article page. {Dede: field. id function = "listtag (@ me )"/} |
To sum up, dedecms is not suitable for calling the tag below in the article. Currently, seo/seo.html "target =" _ blank "> The website has been optimized, so we need to make improvements.