Home > Article > CMS Tutorial > How Imperial CMS achieves the click effect of search keywords
The example of this article describes the method of Imperial CMS to achieve the click effect of search keywords. Share it with everyone for your reference. The specific implementation method is as follows:
1. Create a custom JS template: The template content is as follows:
The code is as follows:
[!--empirenews.listtemp--]<a href='/e/search/result/?searchid=[!--id--]'>[!--title--]([!--writer--]) </a> [!--empirenews.listtemp--]
Explanation: The writer field here is originally It is the author, but it is not needed here. We use it to over-receive the click number OnClick field.
It is recommended to study "Empire cms tutorial"
2. Create a new custom JS, the query SQL statement is as follows, remember to select the template as the newly created template we just created:
The code is as follows:
select searchid as id,keyboard as title,onclick as writer from [!db.pre!]enewssearch where iskey=0 order by onclick desc limit 10
I hope this article will be helpful to everyone’s Imperial CMS website building.
The above is the detailed content of How Imperial CMS achieves the click effect of search keywords. For more information, please follow other related articles on the PHP Chinese website!