DEDECMS5.7 Home List page call tag tag (link) tutorial

Source: Internet
Author: User
Tags tagname urlencode

dedecms v5.7 version directly using the tag: [Field:id function=gettags (@me)/], it can be called out
Just without the connection, if you need to connect, please comment out the 130 lines of the include\helpers\archive.helper.php file:

$tags. = ($tags = = "? $row [' Tag ']: ', '. $row [' tag ']);

Replace with the following statement, where you can add your own style

$tags. = "<a href= '/tags.php?/". UrlEncode ($row [' tag ']). " /' > '. $row [' tag ']. " </a> ";

Here's a DedeCMSv5.6 and its previous version:

Dedecms default in the list is not able to call the tag tag, after the help of the moderator, now provide you with a method

Method 1:

Add the following code where the list is needed

[Field:id Runphp=yes]

$tsql = new Dedesql (false);

$tags = ";

$tsql->setquery ("Select I.tagname from Dede_tag_list t left joins Dede_tag_index I on I.id=t.tid where t.aid= ' @me '");

$tsql->execute (' t ');

while ($row = $tsql->getarray (' t ', Mysql_assoc)) {

$tags. = "<a href= '/tag.php?/". UrlEncode ($row [' tagname ']). "' > ". $row [' tagname ']." </a> ";

}

@me = $tags;

[/field:id]

Method 2:

Add in the inc_functions.php file

function Listtag ($aid) {

$tsql = new Dedesql (false);

$tags = ";

$tsql->setquery ("Select I.tagname from Dede_tag_list t left joins Dede_tag_index I on I.id=t.tid where t.aid= ' $aid '");

$tsql->execute (' t ');

while ($row = $tsql->getarray (' t ', Mysql_assoc)) {

$tags. = "<a href= '/tag.php?/". UrlEncode ($row [' tagname ']). "' > ". $row [' tagname ']." </a> ";

}

return $tags;

}

Then add it to the list page at the appropriate location

[Field:id function= "Listtag (@me)"/] Mark

DEDECMS5.7 Home List page call tag tag (link) tutorial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.