织梦常用
导入头尾文件:
{dede:include filename="header.html"/}
调用网站关键字和站点描述:
<meta name="keywords" content="{dede:field name='keywords'/}" /> <meta name="description" content="{dede:field name='description' function='html2text(@me)'/}" />
调用样式表与图片路径:
{dede:global.cfg_templets_skin/}/
调用顶级和二级菜单:
<ul class="nav nav-pills pull-right"> <li><a href="/">首页</a></li> {dede:channelartlist typeid='top'} <li class="dropdown"> <a href="'{dede:field name='typeurl/}" class="dropdown-toggle" >{dede:field name='typename'/}</a> <ul class="dropdown-menu"> {dede:channel type='son' noself='true'} <li><a href="[field:typelink/]">[field:typename/]</a></li> {/dede:channel} </ul> </li> {/dede:channelartlist} </ul>
面包屑导航:
{dede:field name='position'/}
根据指定栏目id调用缩略图(通常用于内页banner):
{dede:arclist typeid='20' row='1' orderby='pubdate'} <a href="[field:arcurl/]"><img src="[field:litpic/]" alt="" width="100%" /></a> {/dede:arclist}
调用二级菜单:
{dede:channel type='son' noself='true'} <li><a href="[field:typelink/]">[field:typename/]</a></li> {/dede:channel}
调用本栏目名称:
{dede:field.title/}
调用栏目内容:
{dede:field.content/}
根据id调用指定栏目的文章:
{dede:arclist typeid='8' titlelen=50 row=3} <div class="new-dongtai1"> <div class="time"> <strong>[field:pubdate function=MyDate('d',@me)/]</strong> <h6>[field:pubdate function=MyDate('Y',@me)/]-[field:pubdate function=MyDate('m',@me)/]</h6> </div> <div class="new-text"> <h6 class="tit"><a href="[field:arcurl/]">[field:title/]</a></h6> <h6 class="n-rong">[field:description function='cn_substr(@me,250)'/]...<a href="[field:arcurl/]">查看详情</a></h6> </div> </div> {/dede:arclist}
调用指定属性的文章及缩略图:
{dede:arclist flag='c' titlelen=50 row=1} <div class="news_hot"> <div class="news_hot_l"> <div class="news_hot_date"> [field:pubdate function="GetDateTimeMK(@me)"/] </div> <div class="news_hot_tit"> <a href="[field:arcurl/]">[field:title/]</a> </div> <div class="news_hot_info"> [field:description function='cn_substr(@me,450)'/]... </div> <a href="[field:arcurl/]" class="news_hot_more">查看详情</a> </div> <div class="news_hot_r"> <a href="[field:arcurl/]"><img src="[field:picname/]" /></a> </div> </div> {/dede:arclist}