Home  >  Article  >  php教程  >  dedecms hot article sorting

dedecms hot article sorting

WBOY
WBOYOriginal
2016-08-04 08:57:051226browse

Recently, I helped a friend manage a travel website - Beihai Nanzhu Holidays. This website was built using the dedecms program. The structure is relatively simple, but there is still quite a lot of content. Although I am no stranger to dedecms, I have not been exposed to it for several years. I was suddenly asked to revise it, and I was really at a loss for the moment. The program version of the website is DedeCmsV5.5_GBK. I checked on the dedecms official website and found that the latest version is DedeCmsV5.7, but the template tag syntax has basically not changed much. I want to read the help manual, but I can't open it! Helpless, then I can only slowly debug and accumulate.

The following is a template tag fragment for sorting travel information by hot spots. The syntax is "orderby='click'", which means the ones with the most clicks are ranked first.

<ul>
   {dede:arclist titlelen=28 channelid=&#39;24&#39; typeid=&#39;94&#39; row=&#39;10&#39; orderby=&#39;click&#39;}
        <li><a href="[field:arcurl/]" title="[field:fulltitle/]">[field:fulltitle  function=&#39;substr(@me,0,34)&#39;/]</a></li>
    {/dede:arclist}
 </ul>

The template tag function above is to list 10 articles sorted by their click-through rate. Here is a brief introduction to other tag syntax:

{dede:arclist} {/dede:arclist}: The opening and closing tags of the article list

titlelen=28:

Control the number of displayed words in the article title

channelid='24' : Channel ID is 24

typeid='94': Column ID is 94

row='10': List 10 articles

[field:arcurl/]:Article hyperlink

[field:fulltitle/] : Article title

[field:fulltitle function='substr(@me,0,34)'/]: The length of the intercepted article title is 34 bytes, which is 17 words.



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