Home  >  Article  >  CMS Tutorial  >  How to judge dedecms template tags

How to judge dedecms template tags

藏色散人
藏色散人Original
2019-12-23 10:10:322759browse

How to judge dedecms template tags

How to judge the dedecms template tag?

dedecms template tags can be judged, but it depends on which tag it is. Some tags cannot be judged. The source file must be changed. There is an example below. Interested friends can refer to

It depends on which tag it is. Some tags cannot be judged. The source file must be changed,

Commonly used loops, autoindex, etc.

Add: runphp="yes" to the tag.

比如:[field:pubdate runphp='yes'] 
$a="<font color=red>".strftime(&#39;%m-%d&#39;,@me)."</font>"; 
$b=strftime(&#39;%m-%d&#39;,@me); 
$ntime = time(); 
$day3 = 3600 * 24; 
if(($ntime - @me) < $day3) @me = $a; 
else @me =$b; 
[/field:pubdate]<br> 
[field:global name=autoindex runphp="yes"] 
if(@me%5==0)@me="<hr />"; 
else @me=""; 
[/field:global] 这个是判断,列表每隔5行加横线 。

Recommended learning: 梦Weavingcms

The above is the detailed content of How to judge dedecms template tags. 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