标题 / 关键词 / 描述title / keywords / description
{dede:field.title/}_{dede:global.cfg_webname/}
SEO标题seotitle / keywords / description
{dede:field.seotitle /} - {dede:global.cfg_webname/}
获取顶级栏目相关信息gettoptype(@me,typename)
{dede:field.typeid function=gettoptype(@me,typename)/}
获取上级栏目相关信息getredtype(@me,typename)
{dede:field.typeid function=getredtype(@me,typename)/}
栏目文档数据列表{dede:list}{/dede:list}
{dede:list pagesize='10' titlelen='250'}{/dede:list}
栏目分页条标签{dede:pagelist/}
{dede:pagelist listitem="index,end,pre,next,pageno" listsize="3" pagelang=""/}
栏目文档总数量(二开){dede:itemcount/}
{dede:itemcount listsize='4'/}
栏目分页条通用样式CSS代码
.my_pages{clear:both!important;padding:5px 0 0;text-align:center;margin:5px auto;line-height:30px;}
.my_pages ul{text-align:center;list-style:none;}
.my_pages ul li{list-style:none;text-align:center;height:24px;display:inline;margin:0 2px;padding:0;overflow:hidden;white-space:nowrap;font-size:13px;}
.my_pages ul li a{background:#fff;color:#555;display:inline;height:24px;overflow:hidden;padding:6px 10px;margin:0;border: #999 1px solid;}
.my_pages ul li a:hover{color:#fff;background:#FF6600;border:#FF6600 1px solid;height:24px;overflow:hidden;text-decoration:none;cursor:pointer;}
.my_pages ul li.thisclass a{background:#FF6600;border:#FF6600 1px solid;height:24px;overflow:hidden;color:#fff;font-weight:700;}
搜索页-搜索 XXX 的结果
搜索 {dede:global.keyword function=RemoveXSS(@me)/} 的结果
自增+取余[中括号][field:global name=autoindex/]
[field:global name=autoindex runphp=yes](@me%4==1) ? @me='
':@me='';[/field:global]
首页模板调用代码 index.htm
文档列表(常用){dede:arclist}{/dede:arclist}
{dede:arclist typeid='' row='' titlelen='50' channelid='' addfields='' flag='' isweight='' orderby='' orderway='' limit=''}[field:title/]{/dede:arclist}
文章内容摘要[field:description/]
[field:description function=cn_substr(@me,250)/]
文章时间格式 2020-1-1[field:pubdate/]
[field:pubdate function="MyDate('Y-m-d',@me)"/]
文章时间格式 May 15, 2020[field:pubdate/]
[field:pubdate function='strftime("%b %d, %Y",@me)'/]
获取一个栏目链接{dede:type}{/dede:type}
{dede:type typeid=}[field:typeurl/]{/dede:type}
获取一个栏目内容(二开)[field:content/]
{dede:type typeid=}[field:content function=cn_substr(html2text(@me),380)/]{/dede:type}
友情链接{dede:flink}{/dede:flink}
{dede:flink type='text' row='100'}[field:url/][field:webname/]{/dede:flink}
幻灯大图小图(插件){dede:myppt}{/dede:myppt}
{dede:myppt typeid=1 row=6}[field:url/][field:pic/][field:pic2/][field:title/]{/dede:myppt}
头部尾部调用代码 head.htm / foot.htm
首页高亮判断首页
{dede:field name=typeid runphp=yes}(@me=='')? @me=' class="current"':@me='';{/dede:field}
channelartlist多个栏目调用dede:channelartlist
{dede:channelartlist row=7 typeid=top currentstyle=current}{dede:field.typeurl/}{dede:field.typename/}{/dede:channelartlist}
自增{大括号}dede:global.itemindex
{dede:global name=itemindex/}
自增+判断{大括号}dede:global.itemindex +
{dede:global name=itemindex runphp=yes}if(@me==1)@me=' class="current"';else @me='';{/dede:global}
是否最后一个(二开)dede:global.iflast
{dede:global name=iflast runphp=yes}if (@me) @me = '';else @me = '|';{/dede:global}
栏目外部链接新窗口打开dede:field.ispart
{dede:field.ispart runphp=yes}(@me==2)? @me=' target="_blank"':@me='';{/dede:field.ispart}
判断是否有下级栏目dede:field.typeid runphp=yes
{dede:field name=typeid runphp=yes}global $dsql;$sql = "SELECT id FROM `#@__arctype` WHERE reid='@me' And ishidden<>1 order by sortrank asc limit 0,1";$row = $dsql->GetOne($sql);@me=is_array($row)?'有下级':'没下级';{/dede:field}
channel顶级栏目+高亮dede:channel type='top'
{dede:channel type='top' row='7' currentstyle="~typename~"}
[field:typename/]
{/dede:channel}
自增+判断[中括号][field:global name=autoindex/]
[field:global name=autoindex runphp=yes](@me==1)? @me=' class="current"':@me='';[/field:global]
是否最后一个(二开)dede:global.iflast
[field:global name=iflast runphp=yes]if (@me) @me = '';else @me = '|';[/field:global]
栏目外部链接新窗口打开dede:field.ispart
[field:ispart runphp=yes](@me==2)? @me=' target="_blank"':@me='';[/field:ispart]
其他织梦仿站标签
[首页/列表页模板] 缩略图为空不输出,不为空输出html和多个字段
[field:array runphp=yes]
global $cfg_basehost,$cfg_templets_skin;
@me = (stristr(@me['litpic'],'defaultpic') ? "" : "
");[/field:array]
[首页/列表页模板] 缩略图为空不输出,不为空输出html和缩略图字段
[field:litpic runphp=yes]if(stristr(@me,'defaultpic'))@me = "";else @me = "
[首页/列表页模板] 另一种索引自增判断含多字段
[field:array runphp=yes]
if($GLOBALS[autoindex]%4==0)@me="{@me['litpic']}";else @me="{@me['title']}";
[/field:array]
[内容页模板] 缩略图为空不输出,不为空输出html和多个字段
{dede:field name=array runphp=yes}
global $cfg_basehost,$cfg_templets_skin;
@me = (stristr(@me['litpic'],'defaultpic') ? "" : "
");{/dede:field}
[内容页模板] 缩略图为空不输出,不为空输出html和缩略图字段
{dede:field.litpic runphp=yes}if(stristr(@me,'defaultpic'))@me = "";else @me = "
[内容页模板] 另一种索引自增判断含多字段
{dede:field name=array runphp=yes}
if($GLOBALS[autoindex]%4==0)@me="{@me['litpic']}";else @me="{@me['title']}";
{/dede:field}
dede:sql 文档链接的写法
{dede:sql sql="SELECT * FROM #@__archives WHERE arcrank>-1 AND id in(~myid~) ORDER BY FIELD(id,~myid~)"}
[field:description/]
{/dede:sql}
dede:sql 栏目链接的写法
{dede:sql sql="SELECT * FROM #@__arctype WHERE reid=1 AND typename=~title~"}
{/dede:sql}
dede:sql 首页输出栏目内容的写法
{dede:sql sql="SELECT content FROM #@__arctype WHERE id=43"}
[field:content function=cn_substr(html2text(@me),380)/]...
{/dede:sql}
dede:sql 列表页内容页关键词输出相关文档+自定义字段
{dede:sql sql="SELECT arc.*,addf.* FROM `#@__archives` arc LEFT JOIN `#@__addon19` addf ON arc.id=addf.aid WHERE arc.arcrank>-1 AND CONCAT(arc.title,arc.keywords) REGEXP ~keywords~ LIMIT 9"}
价格:[field:jiage/]
{/dede:sql}
一级 / 二级 / 三级 栏目调用
{dede:channelartlist row=7 typeid=top currentstyle=current}
{dede:channel type=son noself=yes}
[field:id runphp=yes]
global $dsql;
$sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `#@__arctype` WHERE reid=@me And ishidden<>1 ORDER BY sortrank ASC LIMIT 0,10";
$dsql->SetQuery($sql);
$dsql->Execute('t');
$result = '';
while($row = $dsql->GetArray('t'))
{
$typename = $row['typename'];
$typeurl = GetOneTypeUrlA($row);
$result .= "
{$typename}";}
@me = $result;
[/field:id]
{/dede:channel}
{/dede:channelartlist}
一级 / 二级 / 二级栏目下的文章+自定义字段调用
{dede:channelartlist row=7 typeid=top currentstyle=current}
{dede:channel type=son noself=yes}
[field:id runphp=yes]
global $dsql;
$sql = "SELECT arc.*,addf.* FROM `#@__archives` arc LEFT JOIN `#@__addonarticle` addf ON arc.id=addf.aid WHERE arc.arcrank>-1 AND arc.typeid=@me ORDER BY arc.id DESC limit 0,10";
$dsql->SetQuery($sql);
$dsql->Execute('t');
$result = '';
while($row = $dsql->GetArray('t'))
{
$arcrow = GetOneArchive($row['id']);
$row['arcurl'] = $arcrow['arcurl'];
$row['pubdate'] = MyDate('Y-m-d',$row['pubdate']);
$result .= "
时间:{$row['pubdate']} {$row['title']}}
@me = $result;
[/field:id]
{/dede:channel}
{/dede:channelartlist}
手机模板标签
xxxxxx_m.htm
channelartlist多个栏目调用dede:channelartlist
{dede:channelartlist row=7 typeid=top currentstyle=current}
{dede:global.cfg_mobileurl/}/list.php?tid={dede:field.typeid/}
{dede:field.typename/}
{/dede:channelartlist}
channel顶级栏目调用dede:channel type='top'
{dede:channel type='top' row='7'}
[field:global.cfg_mobileurl/]/list.php?tid=[field:id/]
[field:typename/]
{/dede:channel}
channel子级栏目调用dede:channel type='son'
{dede:channel type=son noself=yes}
[field:global.cfg_mobileurl/]/list.php?tid=[field:id/]
[field:typename/]
{/dede:channel}
获取一个栏目链接{dede:type}{/dede:type}
{dede:type typeid=}[field:global.cfg_mobileurl/]/list.php?tid=[field:id/]{/dede:type}
首页/列表页文档链接view.php?aid=1
[field:global.cfg_mobileurl/]/view.php?aid=[field:id/]
首页/列表页缩略图PC+litpic
[field:global.cfg_basehost/][field:litpic/]
内容页缩略图PC+litpic
{dede:global.cfg_basehost/}{dede:field.litpic/}
文章内容(去除图片宽高+绝对路径){dede:field.body/}
{dede:field.body runphp=yes}
global $cfg_basehost;
$str = @me;
$search = '/(]+>)/is';
$search1 = '/(]+>)/is';
$search2 = '#()#i';
$search3 = '#()#i';
$content = preg_replace($search,'$1$3',$str);
$content = preg_replace($search1,'$1$3',$content);
$content = preg_replace($search2,'$1$2',$content);
$content = preg_replace($search3,'$1$2',$content);
@me = str_replace('/uploads/', $cfg_basehost.'/uploads/', $content);
{/dede:field.body}
栏目内容(去除图片宽高+绝对路径){dede:field.content/}
{dede:field.content runphp=yes}
global $cfg_basehost;
$str = @me;
$search = '/(]+>)/is';
$search1 = '/(]+>)/is';
$search2 = '#()#i';
$search3 = '#()#i';
$content = preg_replace($search,'$1$3',$str);
$content = preg_replace($search1,'$1$3',$content);
$content = preg_replace($search2,'$1$2',$content);
$content = preg_replace($search3,'$1$2',$content);
@me = str_replace('/uploads/', $cfg_basehost.'/uploads/', $content);
{/dede:field.content}