帝国cms教程栏目,提供精品建站,仿站,二次开发,安装,标签使用等图文教程,帮助建设和管理好你的帝国cms站点。
内容模板是指信息内容页面使用的模板。本文将从管理内容模板,内容模板制作范例,以及内容模板的其他说明,三个方面来讲解。希望对您使用帝国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--]:相关链接 |
[!--p.title--]:分页标题 | [!--ttid--]:标题分类ID | [!--tt.name--]:标题分类名称 |
[!--class.url--]:栏目页面地址 | [!--news.url--]:网站地址(参数设置的站点地址) | [!--no.num--]:信息编号 |
[!--userid--]:发布者ID | [!--username--]:发布者 | [!--linkusername--]:带链接的用户名 |
[!--userfen--]:查看信息扣除点数 | [!--pinfopfen--]:平均评分 | [!--infopfennum--]:评分人数 |
[!--onclick--]:点击数 | [!--totaldown--]:下载数 | [!--plnum--]:评论数 |
[!--page.url--]:分页导航 | [!--title.select--]:标题式分页导航 | [!--next.page--]:内容下一页链接 |
[!--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代码 |
|
实现如下效果:
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></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="https://www.phome.net">EmpireCMS</a> ©
2002-2011 Phome.net Corporation<br>
</div></td>
</tr>
</table>
</body>
</html>
至此内容模板美工手册介绍完毕!
转载请注明来源:帝国cms内容模板制作教程
本文永久链接地址:https://www.moyouyouw.cn/code/20.html
郑重声明:本站所有主题/文章除标明原创外,均来自网络转载,版权归原作者所有,如果有侵犯到您的权益,请联系本站删除,谢谢!我们不承担任何技术及版权问题,且不对任何资源负法律责任。
上一篇
下一篇
售价: 300 16 ℃ 0 评论
售价: 300 8 ℃ 0 评论
售价: 200 22 ℃ 0 评论
已有 位小伙伴发表了看法
欢迎 你 发表评论