ECMS 6.6/列表模板
列表模板制作格式[ ]
列表头
[!--empirenews.listtemp--]
列表内容
[!--empirenews.listtemp--]
列表尾
说明:第一个[!--empirenews.listtemp--]表示循环开始、第二个[!--empirenews.listtemp--]表示循环结束。
管理列表模板[ ]
登录后台[ ]
单击“模板”菜单,选择“管理列表模板”子菜单,进入管理列表模板界面:
进入管理列表模板界面:[ ]
点击默认新闻列表模板的“修改”进入修改列表模板界面:[ ]
列表模板支持的变量:[ ]
(1)、页面模板内容支持的变量
(2)、列表内容模板(list.var)支持的变量
列表模板制作范例[ ]
实现如下效果:
制作列表模板[ ]
使用Dreamweaver制作列表模板
在制作好的界面加入模板标签及变量:[ ]
页面标题变量:[!--pagetitle--],调用位置如下图①③所示;
导航条变量[!--newsnav--]:调用位置如下图②所示。
分页导行(下拉式)变量:[!--show.page--],调用位置如下图⑤所示;
插入列表模板内容变量:即列表页所有信息的显示样式变量,如“(每行显示1条信息)”、“(每行显 示2条信息)”等,调用位置如下图④所示。
格式:列表头[!--empirenews.listtemp--]列表内容[!--empirenews.listtemp--]列表尾
图1:设计视图
图2: 代码模式
制作列表内容模板[ ]
即内容变量所显示的内容。代表每条信息的显示样式。
如“·台"金援外交"丑闻涉案人遭到恐吓 警方加强保护 (2008-05-04)”,
该样式包括:标题,发布时间,标题链接三部分,分别对应的变量标签为[!--title--]、[!--newstime--]、[!--titleurl--],
则该信息样式可写为:(Dreamweaver可视化制作)
图1:设计视图
图2: 代码模式
将制作好的列表模板代码拷贝到系统后台“列表模板”中:[ ]
(1)、单击“模板”菜单 》列表模板-“管理列表模板”,选择右侧的默认新闻列表模板,单击“修改”:
(2)、进入修改默认新闻列表模板界面,将制作好的列表模板代码拷贝进去:
修改模板后,刷新栏目页面[ ]
最终列表模板的预览效果:
附上面例子模板代码[ ]
列表页面模板代码
<!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"><a href="/php"><strong>[!--pagetitle--]</strong></a></td> </tr> <tr> <td bgcolor="#FFFFFF"><br> <table width="100%" border="0" cellspacing="0" cellpadding="0"> [!--empirenews.listtemp--] <tr> <td height="23"> <!--list.var1--> </td> </tr> [!--empirenews.listtemp--] </table> </td> </tr> <tr> <td height="23" bgcolor="#FFFFFF">[!--show.page--]</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.phome.net">EmpireCMS</a> © 2002-2011 Phome.net Corporation<br> </div></td> </tr> </table> </body> </html>
列表内容模板(list.var)
<a href="[!--titleurl--]" target="_blank">[!--title--]</a> (<font color="#666666">[!--newstime--]</font>)