帝国CMS模板制作教程:内容模板详解

内容模板是指信息内容页面使用的模板。

管理内容模板1、登录后台,单击“模板”菜单,选择“管理内容模板”子菜单,进入管理内容模板界面:2、进入管理内容模板界面:3、点击默认新闻内容模板的“修改”进入修改内容模板界面:

模板名填写模板名称。所属系统模型指这个内容模板用于的系统模型所属分类方便统一按分类管理。时间显示格式设置newstime发布时间字段的时间格式,如“Y-m-d”就是显示“2008-08-08”模板内容内容模板的模板内容。

4、内容模板支持的变量:

[!–pagetitle–]:页面标题[!–pagekey–]:页面关键字[!–pagedes–]:页面描述[!–newsnav–]:导航条[!–class.menu–]:一级栏目导航[!–page.stats–]:统计访问[!–id–]:信息ID[!–titleurl–]:标题链接[!–keyboard–]:关键字[!–classid–]:栏目ID[!–class.name–]:栏目名称[!–self.classid–]:本栏目ID[!–bclass.id–]: 父栏目ID[!–bclass.name–]:父栏目名称[!–other.link–]:相关链接帝国CMS模板制作教程:内容模板详解:分页标题[!–ttid–]:标题分类ID[!–tt.name–]:标题分类名称[!–class.url–]:栏目页面地址[!–news.url–]:网站地址(参数设置的站点地址)[!–no.num–]:信息编号[!–userid–]:发布者ID[!–username–]:发布者[!–linkusername–]:带链接的用户名[!–userfen–]:查看信息扣除点数[!–pinfopfen–]:平均评分[!–infopfennum–]:评分人数[!–onclick–]:点击数[!–totaldown–]:下载数[!–plnum–]:评论数:分页导航:标题式分页导航:内容下一页链接[!–info.next–]:下一篇链接[!–info.pre–]:上一篇链接[!–info.vote–]:信息投票[!–hotnews–]:热门信息JS调用(默认表)[!–self.hotnews–]:本栏目热门信息JS调用[!–newnews–]:最新信息JS调用(默认表)[!–self.newnews–]:本栏目最新信息JS调用[!–goodnews–]:推荐信息JS调用(默认表)[!–self.goodnews–]:本栏目推荐信息JS调用[!–hotplnews–]:评论热门信息JS调用(默认表)[!–self.hotplnews–]:本栏目评论热门信息JS调用[!–firstnews–]:头条信息JS调用(默认表)[!–self.firstnews–]:本栏目头条信息JS调用[!–字段名–]:数据表字段内容调用支持公共模板变量支持所有模板标签支持PHP代码

其它JS调用及地址说明

实时显示点击数(不统计)<script src=[!–news.url–]e/public/ViewClick/?classid=[!–classid–]&id=[!–id–]></script>实时显示点击数(显示+统计)<script src=[!–news.url–]e/public/ViewClick/?classid=[!–classid–]&id=[!–id–]&addclick=1></script>实时显示下载数<script src=[!–news.url–]e/public/ViewClick/?classid=[!–classid–]&id=[!–id–]&down=1></script>实时显示评论数<script src=[!–news.url–]e/public/ViewClick/?classid=[!–classid–]&id=[!–id–]&down=2></script>实时显示平均评分数<script src=[!–news.url–]e/public/ViewClick/?classid=[!–classid–]&id=[!–id–]&down=3></script>实时显示评分人数<script src=[!–news.url–]e/public/ViewClick/?classid=[!–classid–]&id=[!–id–]&down=4></script>实时显示顶数<script src=[!–news.url–]e/public/ViewClick/?classid=[!–classid–]&id=[!–id–]&down=5></script>实时显示踩数<script src=[!–news.url–]e/public/ViewClick/?classid=[!–classid–]&id=[!–id–]&down=6></script>上面多变量同时显示(变量1为显示,0为不显示)<script src=[!–news.url–]e/public/ViewClick/ViewMore.php?classid=[!–classid–]&id=[!–id–]&onclick=1&down=1&plnum=1&pfen=0&pfennum=0&diggtop=0&diggdown=0&addclick=0></script>显示内容地方要加id="变量showdiv",比如点击数:<span id="onclickshowdiv">0</span>购物车地址[!–news.url–]e/ShopSys/buycar/?classid=[!–classid–]&id=[!–id–] 内容模板制作范例实现如下效果:1、用dreamweaver制作好网页界面2、在制作好的界面加入模板标签及变量:页面标题变量:[!–pagetitle–],调用位置如下图①所示;导航条变量[!–newsnav–]:调用位置如下图②所示。标题字段变量:[!–title–],调用位置如下图③所示;新闻内容字段变量:[!–newstext–],调用位置如下图④所示。3、将制作好的内容模板代码拷贝到系统后台“内容模板”中:1)、单击“模板”菜单 》内容模板-“管理内容模板”,选择右侧的默认新闻内容模板,单击“修改”:(2)、进入修改默认新闻内容模板界面,将制作好的内容模板代码拷贝进去:4、修改模板后,刷新信息页面,最终内容模板的预览效果:5、附上面例子模板代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>[!–pagetitle–]</title><style>td {font-size: 10pt;line-height: 14pt;}.line{font-size: 10pt;line-height: 14pt;}A:link {text-decoration: none; color:#000000}A:visited {text-decoration: none; color: #000000} A:active {text-decoration: underline; color: #000000 } A:hover {text-decoration: underline; color: #FF0000;}</style></head><body topmargin="0"><table width="700" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CEEEFB"> <tr> <td height="60"> <div align="center"><font size="4"><strong>帝国CMS测试站点</strong></font></div&gt;</td> </tr> <tr> <td height="25" bgcolor="#FFFFFF"> <div align="center"><a href="/">网站首页</a> | <a href="/news/china/">国内新闻</a> | <a href="/news/world/">国际新闻</a> | <a href="/news/ent/">娱乐新闻</a> | <a href="/news/sports/">体育新闻</a></div></td> </tr></table><table width="700" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="50%" height="25">当前位置:[!–newsnav–]</td> </tr></table><table width="700" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CEEEFB"> <tr> <td height="23"><div align="center"><strong>[!–title–]</strong></div></td> </tr> <tr> <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="23">[!–newstext–]</td> </tr> </table></td> </tr></table><br><table width="700" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CEEEFB"> <tr> <td height="23"><div align="center">Powered by <a href="http://www.68idc.cn">Aspku</a> &copy; 2002-2011 Phome.net Corporation<br> </div></td> </tr></table></body></html>

累死累活不说,走马观花反而少了真实体验,

帝国CMS模板制作教程:内容模板详解

相关文章:

你感兴趣的文章:

标签云: