ECSHOP增加单页面的方法

点击次数:4995 发布时间:2013-6-15

 很多用户想在ECSHOP里增加一些单页面,但是ECSHOP却没有这个功能,下面是如果在ECSHOP增加单页面的方法:
1,在根目录创建一个php文件,命名为xxx.php
里面加入代码
<?php
/**
* XX网站 xxx活动专题//2011.7.18
* ============================================================================
* 网站地址: 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,在模板文件夹里面创建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 -->
把你创建的html里面的html内容复制放在这里
<div id="footer">
<!-- #BeginLibraryItem "/library/page_footer.lbi" --><!-- #EndLibraryItem -->
</div></div>
</body>
</html>

这样通过前台访问xxx.php就可以显示你的页面内容了,而且头部和尾部都是调用的!
注意里面的div内容,根据自己的css修改。以免造成错位等!
如果你网站开通了伪静态访问,也想伪静态访问此php文件,阿帕奇下可以在
# direct one-word access

RewriteRule ^index\.html$ index\.php [L]

RewriteRule ^category$ index\.php [L]
复制代码
下面增加一行
RewriteRule ^xxx\.html$ xxx\.php [L]
复制代码
即可通过前台xxx.html访问该页面!


  • 添加微信

  • 联系电话

    0851-86720570