1.url标签
{dede:global.cfg_templets_skin/}
2.引用标签 header footer
{dede:include filename=”header.htm”/}
{dede:include filename=”footer.htm”/}
3.当前位置:
{dede:field name=’position’/}
4.文章数据
因为dede系统 自带文章字段定义 因此输出变量
{dede:field.字段名/}
如
标题:
{dede:field.title/}
特殊:
(责任编辑:{dede:adminname/})
时间:{dede:field.pubdate function=”MyDate(‘Y-m-d H:i’,@me)”/}
点击量编写:
<script src=”{dede:field name=’phpurl’/}/count.php?view=yes&aid={dede:field name=’id’/}&mid={dede:field name=’mid’/}” type=’text/javascript’ language=”javascript”></script>
{dede:field.click/}
简介:
{dede:field.description runphp=’yes’}
{/dede:field.description}
———————-
{dede:field.description runphp=’yes’}
if(@me<>” )@me = ‘
<div class=”intro”>’.@me.'</div>
‘;
{/dede:field.description}
文章数据 字段如下
{dede:field.array runphp=’yes’ }@me = print_r(@me,true);{/dede:field.array}
Array
(
[id] =>
[typeid] =>
[typeid2] =>
[sortrank] =>
[flag] =>
[ismake] =>
[channel] =>
[arcrank] =>
[click] =>
[money] =>
[title] =>
[shorttitle] =>
[color] =>
[writer] =>
[source] =>
[litpic] =>
[pubdate] =>
[senddate] =>
[mid] =>
[keywords] =>
[lastpost] =>
[scores] =>
[goodpost] =>
[badpost] =>
[voteid] =>
[notpost] =>
[description] =>
[filename] =>
[dutyadmin] =>
[tackid] =>
[mtype] =>
[weight] =>
[reid] =>
[typedir] =>
[addtable] =>
[tags] =>
[aid] =>
[position] =>
[phpurl] =>
[indexurl] =>
[templeturl] =>
[memberurl] =>
[specurl] =>
[indexname] =>
[templetdef] =>
[redirecturl] =>
[templet] =>
[userip] =>
[displaytype] =>
[body] =>
[typename] =>
[totalpage] =>
[picname] =>
[image] =>
[badper] =>
[goodper] =>
[nowpage] =>
)
5.列表页面 特殊标签
列表代码
{dede:list pagesize=’10’}
[field:title/]
[field:arcurl/]
[field:litpic/]
[field:typename/]
[field:typeurl/]
{/dede:list}
分页代码
<ul class=”pagelist”>
{dede:pagelist listitem=”info,index,end,pre,next,pageno,option” listsize=”5″/}
</ul>
6.公共标签
{dede:…………/}
全局变量
网站名字:
{dede:global.cfg_webname/}
网站模板目录url
{dede:global.cfg_templets_skin/}
其他的 参考 网站后台 -> 基本参数
———————————————-
文章列表:arclist
{dede:arclist typeid=’2′ row=’5′ }
图片:[field:litpic/]
<li> <a href=”[field:typeurl/]”>[field:typename/]</a> – <a href=”[field:arcurl/]”>[field:title/]</a> </li>
{/dede:arclist}
字段参考一下数组:
[field:array runphp=’yes’]@me = print_r(@me,true);[/field:array]
Array
(
[id] => 12
[typeid] => 2
[typeid2] => 0
[sortrank] => 1459843966
[flag] =>
[ismake] => -1
[channel] => 1
[arcrank] => 0
[click] => 121
[money] => 0
[title] => 我叫杨帅,我要找对象
[shorttitle] =>
[color] =>
[writer] => admin
[source] => 未知
[litpic] => /images/defaultpic.gif
[pubdate] => 1459843966
[senddate] => 1459843605
[mid] => 1
[keywords] => 我叫,杨帅,我,要找,对象,有没有,妹子,我想,找,
[lastpost] => 0
[scores] => 0
[goodpost] => 0
[badpost] => 0
[voteid] => 0
[notpost] => 0
[description] => 有没有妹子,我想找对象
[filename] => /plus/view.php?aid=12
[dutyadmin] => 1
[tackid] => 0
[mtype] => 0
[weight] => 8
[typedir] => {cmspath}/html/CSSjiaocheng
[typename] => CSS教程
[corank] => 0
[isdefault] => -1
[defaultname] => index.html
[namerule] => {typedir}/{aid}.html
[namerule2] => {typedir}/list_{tid}_{page}.html
[ispart] => 0
[moresite] => 0
[siteurl] =>
[sitepath] => {cmspath}/html/CSSjiaocheng
[infos] => 有没有妹子,我想找对象
[info] => 有没有妹子,我想找对象
[arcurl] => /plus/view.php?aid=12
[typeurl] => /plus/list.php?tid=2
[picname] => /images/defaultpic.gif
[stime] => 2016-04-05
[typelink] => <a href=’/plus/list.php?tid=2′>CSS教程</a>
[image] => <img src=’/images/defaultpic.gif’ border=’0′ width=’120′ height=’120′ alt=’我叫杨帅,我要找对象’>
[imglink] => <a href=’/plus/view.php?aid=12′><img src=’/images/defaultpic.gif’ border=’0′ width=’120′ height=’120′ alt=’我叫杨帅,我要找对象’></a>
[fulltitle] => 我叫杨帅,我要找对象
[textlink] => <a href=’/plus/view.php?aid=12′>我叫杨帅,我要找对象</a>
[phpurl] => /plus
[plusurl] => /plus
[memberurl] => /member
[templeturl] => /templets
)
详细参考 网站后台 -> 模板 -> 默认模板管理 -> 修改模板
7.获取栏目列表标签
channel
type = ‘top’ 获取顶层栏目
type = ‘son’ typeid= ‘x’ 他有子栏目 输出子栏目 | 没有子栏目输出同级栏目
type = ‘self’ 输入同级栏目 但是typeid 不可是 等级栏目
{dede:channel row = ’10’ type = ‘son’ }
<li><a href='[field:typelink/]’>[field:typename/]</a> </li>
{/dede:channel}
8.单个栏目的链接标签
{dede:type typeid=’1′}
<a href=”[field:typelink /]”>[field:typename /]</a>
{/dede:type}
9.具体某篇文章数据输出
因为dede文章属性 和文章内容不在同一表中 在特定位置调取特定文章方法的 arclist 中 没有body(正文字段) 需要两表关联查询 对其添加字段body
代码:
{dede:arclist idlist =’3′ addfields=’body’ channelid=’1′ }
[field:body/]
{/dede:arclist}