很多用戶想在ECSHOP里增加一些單頁面,但是ECSHOP卻沒有這個功能,下面是如果在ECSHOP增加單頁面的方法:
1,在根目錄創(chuàng)建一個php文件,命名為xxx.php
里面加入代碼
<?php
/**
* XX網(wǎng)站 xxx活動專題//2011.7.18
* ============================================================================
* 網(wǎng)站地址: http://www.majiaping.com;
* ----------------------------------------------------------------------------
* Author: Luery QQ:609198030
* Id: xxx.php 2011-7-18 12:19:16
*/
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
$templates = empty($topic['template']) ? 'xxx.dwt' : $topic['template'];
/* 顯示模板 */
$smarty->display($templates, $cache_id);
?>
2,在模板文件夾里面創(chuàng)建xxx.dwt文件,
添加代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" contect="Luery">
<!-- TemplateBeginEditable name="doctitle" -->
<title>你的頁面標題</title>
<!-- TemplateEndEditable -->
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<link rel="shortcut icon" href="favicon.ico" />
<style type="text/css" media="screen">@import url( css/你的css.css );</style>
<link rel="alternate" type="application/rss+xml" title="RSS|{$page_title}" href="{$feed_url}" />
{* 包含腳本文件 *}
{insert_scripts files='common.js,transport.js'}
</head>
<body>
<div id="container">
<!-- #BeginLibraryItem "/library/page_header.lbi" --><!-- #EndLibraryItem -->
把你創(chuàng)建的html里面的html內(nèi)容復(fù)制放在這里
<div id="footer">
<!-- #BeginLibraryItem "/library/page_footer.lbi" --><!-- #EndLibraryItem -->
</div></div>
</body>
</html>
這樣通過前臺訪問xxx.php就可以顯示你的頁面內(nèi)容了,而且頭部和尾部都是調(diào)用的!
注意里面的div內(nèi)容,根據(jù)自己的css修改。以免造成錯位等!
如果你網(wǎng)站開通了偽靜態(tài)訪問,也想偽靜態(tài)訪問此php文件,阿帕奇下可以在
# direct one-word access
RewriteRule ^index\.html$ index\.php [L]
RewriteRule ^category$ index\.php [L]
復(fù)制代碼
下面增加一行
RewriteRule ^xxx\.html$ xxx\.php [L]
復(fù)制代碼
即可通過前臺xxx.html訪問該頁面!
技術(shù)資訊
ECSHOP增加單頁面的方法
點擊次數(shù):5203 發(fā)布時間:2013-6-15