Dreamweaver's template tags are similar to XML format. All templates contain delimiters. By default, they are {dede:*} and {/dede:*}. , "*" represents the template tag name.
Generally {dede:*} and {/dede:*} appear in pairs, for example: ##Example 1-1:
{dede:arclist flag='h' limit='0,1'} <h2><a href="[field:arcurl/]">[field:title/]</a></h2> <p>[field:description/]...<a href="[field:arcurl/]">[查看全文]</a></p> {/dede:arclist}
For example: 1-2
{dede:global.cfg_webname/} {dede:arclist flag='h' limit='0,1'/}
Comments
The template comments of the Dreamweaver tag are very flexible and can be assigned values through the commet attribute behind the tag.
Example 1-3:
{dede:arclist flag='h' limit='0,1' commet='调用头条的第一篇内容'} <h2><a href="[field:arcurl commet="这是文章链接标签"/]">[field:titlecommet="这是文章标题标签"/]</a></h2> <p>[field:description commet="这是摘要标签"/]...<a href="[field:arcurl commet="这是文章链接标签"/]">[查看全文]</a></p> {/dede:arclist}
Function
Each DreamWeaver tag can be expanded using a custom function. The content of the custom function is mainly used to process the output content of the current tag. .
Example 1-4:
{dede:标记名称function='youfunction("参数一","参数二","@me")'/}
{dede:field.pubdate function='strftime("%Y-%m-%d %H:%M:%S","@me")'/}
Attribute
The attributes of the template tag determine the form of the template tag output. For example, the main function of the arclist tag is to list the document list, but what content is listed? The sorting method depends on the properties of the template tag.
Programming
One of the convenient aspects of Dreamweaver template is that it supports simple template programming.
The format is:
{dede:tagname runphp='yes'} $aaa = @me; @me = "123456"; {/dede:tagname}
The above is the detailed content of DedeCMS template tag syntax. For more information, please follow other related articles on the PHP Chinese website!