ECMS:內容模板
導航: 上一級 | 帝國CMS | 首頁 | DedeCMS | Drupal | PHPCMS | PHP168 | Xoops | Joomla | PowerEasy | SupeSite
內容模板制作
增加內容模板
1、登陸后臺->點擊大菜單“模板管理”>“管理內容模板”,進入如下界面:
圖片1:菜單導航
圖片2:管理內容模板頁面
2、點擊“增加內容模板”按鈕后,進入增加內容模板頁面,如圖:
所屬系統(tǒng)模型 指這個內容模板用于的系統(tǒng)模型 時間顯示格式 格式化發(fā)布時間,如“Y-m-d”就是顯示“2008-08-08” 模板內容 內容模板的模板內容
3、內容模板支持的變量:
[!--pagetitle--]:頁面標題 [!--newsnav--]:導行條 [!--page.stats--]:統(tǒng)計訪問 [!--id--]:信息ID [!--titleurl--]:標題鏈接 [!--keyboard--]:關鍵字 [!--classid--]:欄目ID [!--class.name--]:欄目名稱 [!--self.classid--]:本欄目ID [!--class.intro--]:欄目簡介 [!--class.keywords--]:欄目關鍵字 [!--class.classimg--]:欄目縮略圖 [!--bclass.id--]: 父欄目ID [!--bclass.name--]:父欄目名稱 [!--other.link--]:相關鏈接 [!--fava.url--]:加入收藏鏈接 [!--news.url--]:網站地址(參數(shù)設置的站點地址) [!--no.num--]:信息編號 [!--userid--]:發(fā)布者ID [!--username--]:發(fā)布者 [!--linkusername--]:帶鏈接的用戶名 [!--userfen--]:查看信息扣除點數(shù) [!--pinfopfen--]:平均評分 [!--infopfennum--]:評分人數(shù) [!--onclick--]:點擊數(shù) [!--totaldown--]:下載數(shù) [!--plnum--]:評論數(shù) [!--page.url--]:分頁導行 [!--title.select--]:標題式分頁導行 [!--next.page--]:內容下一頁鏈接 [!--info.next--]:下一篇鏈接 [!--info.pre--]:上一篇鏈接 [!--info.vote--]:信息投票 [!--hotnews--]:熱門信息JS調用(默認表) [!--newnews--]:最新信息JS調用(默認表) [!--goodnews--]:推薦信息JS調用(默認表) [!--self.hotnews--]:本欄目熱門信息JS調用 [!--self.newnews--]:本欄目最新信息JS調用 [!--self.goodnews--]:本欄目推薦信息JS調用 [!--hotplnews--]:評論熱門信息JS調用(默認表) [!--firstnews--]:頭條信息JS調用(默認表) [!--self.hotplnews--]:本欄目評論熱門信息JS調用 [!--self.firstnews--]:本欄目頭條信息JS調用 [!--字段名--]:數(shù)據(jù)表字段內容調用 支持公共模板變量 支持所有模板標簽
其它JS調用及地址說明
實時顯示點擊數(shù)(不統(tǒng)計) <script src=[!--news.url--]e/public/ViewClick?classid=[!--classid--]&id=[!--id--]></script>
實時顯示點擊數(shù)(顯示+統(tǒng)計) <script src=[!--news.url--]e/public/ViewClick?classid=[!--classid--]&id=[!--id--]&addclick=1></script>
實時顯示下載數(shù) <script src=[!--news.url--]e/public/ViewClick?classid=[!--classid--]&id=[!--id--]&down=1></script>
實時顯示評論數(shù) <script src=[!--news.url--]e/public/ViewClick?classid=[!--classid--]&id=[!--id--]&down=2></script>
實時顯示平均評分數(shù) <script src=[!--news.url--]e/public/ViewClick?classid=[!--classid--]&id=[!--id--]&down=3></script>
實時顯示評分人數(shù) <script src=[!--news.url--]e/public/ViewClick?classid=[!--classid--]&id=[!--id--]&down=4></script>
實時顯示頂數(shù) <script src=[!--news.url--]e/public/ViewClick?classid=[!--classid--]&id=[!--id--]&down=5></script>
購物車地址 [!--news.url--]e/ShopSys/buycar?classid=[!--classid--]&id=[!--id--]
內容模板制作范例
實現(xiàn)如下效果:
1、用Dreamweaver制作好界面
2. 在制作好的界面加入模板變量:
3、將制作好的內容模板代碼拷貝到系統(tǒng)后臺“內容模板”中:
登陸后臺->點擊大菜單“模板管理”>“管理內容模板”>點擊“增加內容模板”按鈕,進入增加內容模板界面,如圖:
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{line-height: 14pt;font-size: 10pt;} 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="6">我的個人技術站點</font></div></td> </tr> <tr> <td height="25" bgcolor="#FFFFFF"> <div align="center"><a href="/">網站首頁</a> | <a href="/php">PHP技術</a> | <a href="/asp">ASP技術</a> | <a href="/jsp">JSP技術</a> | <a href="/net">.NET技術</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"><a href="/php"><strong>[!--title--]</strong></a></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 >EmpireCMS</a> © 2008-09 Phome.net Corporation<br> </div></td> </tr> </table> </body> </html>