一、模板文件命名规范:
(1)index_识别ID.htm:板块(栏目封面)模板;
(2)list_识别ID.htm:栏目列表模板;
(3)article_识别ID.htm:内容查看页(文档模板,包括专题查看页);
(4)search.htm:搜索结果列表模板;
(5)index.htm:主页模板;
二、以下为Dedecms常用标签:
1、网站标题:{dede:global.cfg_webname/}
2、站点url(后台设置):{dede:global.cfg_basehost/}
3、站点实际url(推荐):{dede:global.cfg_cmsurl/}
4、会员中心地址:{dede:global.cfg_memberurl/}
5、站点data目录地址:{dede:global.cfg_dataurl/}
6、模板目录地址:{dede:global.cfg_templeturl/}
7、底部版权:{dede:global.cfg_powerby/}
8、备案信息:{dede:global.cfg_beian/}
9、站点plus目录站点地址:{dede:field.phpurl/}
10、网站描述:{dede:global.cfg_description/}
11、网站关键词:{dede:global.cfg_keywords/}
12、模版路径:{dede:global.cfg_templets_skin/}
13、友情链接:{dede:flink row=‘24’/}
14、栏目内容:{dede:field.content/}
15、当前位置:{dede:field.position/}
16、织梦版本:{dede:global.cfg_version/}
17、调用包含模板文件:{dede:include filename="*.htm"/}
18、时间:
{dede:field.pubdate function="MyDate('Y-m-d H:i',@me)"/}
{dede:field name='pubdate' function='strftime("%Y年%m月%d日 %H:%M:%S","@me")' /} //2007年1月1日 18:30:02
{dede:field name='pubdate' function='strftime("%Y-%m-%d %H:%M:%S","@me")' /} //2007-1-1 18:30:02
{dede:field name='pubdate' function='strftime("%Y年%m月%d日 %H时%M分%S秒","@me")' /} //2007年1月1日 18时30分02秒
{dede:field name='pubdate' function='strftime("%m-%d %H:%M:%S","@me")' /} //1-1 18:30:02
{dede:field name='pubdate' function='strftime("%m-%d","@me")' /} //1-1
24小时内的时间显示红色:
[field:pubdate runphp='yes']
$a="<font color='#ff0000'>";
$b="</font>";
$c=strftime("%Y年%m月%d日 %H:%M:%S","@me");
$ntime = time();
$oneday = 3600 * 24;
if(($ntime - @me)<$oneday) @me = $a.$c.$b;
else @me =$c;
[/field:pubdate]
最后更新时间:
{dede:tagname runphp='yes'}@me = date("Y-m-d H:i:s", time());{/dede:tagname}
XX天前:
[field:pubdate runphp='yes']
$today = Floor(time()/(3600 * 24));
$senday= Floor(@me/(3600 * 24));
$updays = $today-$senday;
if($updays==0) @me = "今日";
else @me = $updays."天前";
[/field:pubdate]
19、导航(currentstyle表示高亮显示):
{dede:channel type='self' currentstyle="<span><a href='~typelink~' class='thisclass'>~typename~</a></span>"}
<span><a href='[field:typeurl/]'>[field:typename/]</a></span>
{/dede:channel}
20、用户个人资料:
{dede:memberinfos}
<a href="[field:spaceurl /]" class="userface"><img src="[field:face/]" width="52" height="52" /></a> 头像
<a href='[field:spaceurl