在ecshop中添加页面,并且实现后台管理
后台一共需要修改下面的四个文件
admin/template.php
admin/includes/lib_template.php
languages/zh_cn/admin/template.php
themes/default/libs.xml
1、 首先做模板文件 help.dwt 和 help.php
见下面的 7 和 8 的文件内容
2 、修改 C:/Program Files/ShopEx/shop/docroot/ecshop/languages/zh_cn /admin/template.php
追加如下内容
$_LANG['template_files']['help'] = ' 用户定义帮助 ';
3 、后台就可以显示出用户定义的模板文件了

4 、修改下面一个文件的 bug
C:/Program Files/ShopEx/shop/docroot/ecshop/admin/includes/lib_template.php
将 while ($vals[++$i]['tag'] != 'FILE' || !isset($vals[$i]['attributes']))
修改成
$i++;
while ($vals[$i]['tag'] != 'FILE' || !isset($vals[$i]['attributes'])) // 读出可编辑区库文件名称,放到一个数组中
{
…… $i++;
}
5 、【每个模板允许设置的库项目】做成
C:/Program Files/ShopEx/shop/docroot/ecshop/admin/includes/lib_template.php
在 $page_libs = array(…… 中加入下面代码
'help' => array(
'/library/ur_here.lbi' => 0,
'/library/search_form.lbi' => 0,
'/library/member.lbi' => 0,
'/library/new_articles.lbi' => 0,
'/library/category_tree.lbi' => 0,
'/library/top10.lbi' => 0,
'/library/invoice_query.lbi' => 0,
'/library/recommend_best.lbi' => 3,
'/library/recommend_new.lbi' => 3,
'/library/recommend_hot.lbi' => 3,
'/library/recommend_promotion.lbi' => 4,
'/library/group_buy.lbi' => 3,
'/library/auction.lbi' => 3,
'/library/brands.lbi' => 3,
'/library/promotion_info.lbi' => 0,
'/library/cart.lbi' => 0,
'/library/order_query.lbi' => 0,
'/library/email_list.lbi' => 0,
'/library/vote_list.lbi' => 0
),

6 、编辑可否设定
C:/Program Files/ShopEx/shop/docroot/ecshop/themes/default/libs.xml
加入下面代码,这些区域就变成可指定的了,以外的部分就不能被设定。如果不在这个文件中加入任何信息,所有的项目都是可编辑的
<file name="help.dwt">
<region name=" 左边区域 ">
<lib>cart</lib>
<lib>category_tree</lib>
<lib>top10</lib>
<lib>promotion_info</lib>
<lib>order_query</lib>
<lib>invoice_query</lib>
<lib>vote_list</lib>
<lib>email_list</lib>
</region>
<region name=" 站内快讯上广告位(宽: 210px ) "/>
<region name=" 右边主区域 ">
<lib>recommend_best</lib>
<lib>recommend_new</lib>
<lib>recommend_hot</lib>
<lib>auction</lib>
<lib>group_buy</lib>
</region>
</file>

7 、模板文件 help.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" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>{$page_title}</title>
<!-- TemplateEndEditable --><!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
<meta name="Keywords" content="{$keywords}" />
<meta name="Description" content="{$description}" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="animated_favicon.gif" type="image/gif" />
<link href="{$ecs_css_path}" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- #BeginLibraryItem "/library/page_header.lbi" --><!-- #EndLibraryItem -->
<div class="AreaR">
<!-- 焦点图和站内快讯 START-->
<div class="box clearfix">
<div class="box_1 clearfix">
<div class="f_l" id="focus">
<!-- #BeginLibraryItem "/library/index_ad.lbi" --><!-- #EndLibraryItem -->
</div>
<!--news-->
<div id="mallNews" class="f_r">
<div class="NewsTit"></div>
<div class="NewsList tc">
<!-- TemplateBeginEditable name=" 站内快讯上广告位 " -->
<!-- #BeginLibraryItem "/library/cat_goods.lbi" --><!-- #EndLibraryItem -->
<!-- TemplateEndEditable -->
<!-- #BeginLibraryItem "/library/new_articles.lbi" --><!-- #EndLibraryItem -->
</div>
</div>
<!--news end-->
</div>
</div>
<!-- #BeginLibraryItem "/library/page_footer.lbi" --><!-- #EndLibraryItem -->
</body>
</html>
红色背景部分是可编辑区域,如下图

8 、 help.dwt
<?php
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
assign_template('c', array($cat_id));
$position= assign_ur_here(0, 'asdfasdfaadsfasd');
$smarty->assign('ur_here', $position['ur_here']); // 当前位置
$smarty->display('help.dwt');
?>
9 、最终效果

在ecshop中添加页面,并且实现后台管理的更多相关文章
- CSS 页面布局、后台管理示例
CSS 页面布局.后台管理示例 页面布局 1.头部菜单 2.中间内容/中间左侧菜单 3.底部内容 <div class='pg-header'> <div style='width: ...
- SharePoint 2013 网站定义中添加页面布局
今天在Visual Studio 2012中将页面布局打包到网站定义中. 新建Module “MasterPageGallary” 在Element中如下: <Elements xmlns=&q ...
- Java 在PDF中添加页面跳转按钮
在PDF 中可通过按钮来添加动作跳转到指定页面,包括跳转到文档首页.文档末页.跳转到上一页.下一页.或跳转到指定页面等.下面将通过java代码来演示如何添加具有以上几种功能的按钮. 使用工具: Fre ...
- python :页面布局 ,后台管理页面之左侧菜单跟着滚动条动
左侧菜单跟着滚动条动 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:// ...
- 8 功能6:后台管理页面,编辑文章,xss攻击
1.后台管理页面之文本编辑 # 后台管理url re_path(r'^cn_backend/$', views.cn_backend, name='cn_backend'), re_path(r'^c ...
- 1211 BBS后台管理文章添加
目录 昨日内容回顾 侧边栏inclusion_tag inclusion_tag的响应 使用 自定义inclusion_tag,标签,过滤器 文章的点赞点踩 前端 后端 校验规则 文章的评论功能 1. ...
- 学用MVC4做网站六:后台管理(续)
关于后台的说明: 后台将会用easyui + ajax模式. 这里涉及两个问题,一个是使用easyui如何在前台验证模型的问题,另一个是ajax提交后返回数据. 一.Easyui验证 前台验证采用ea ...
- BBS - 后台管理
一.添加文章 注: 后台管理页面,应该有个新得 app /blog/backend/ # 文章列表页/blog/add_article/ # 添加文章 # 后台管理re_path(r'backend/ ...
- rabbitmq之后台管理和用户设置(三)
前言 前面介绍了erlang环境的安装和rabbitmq环境安装,接下来介绍rabbitmq的web管理和用户设置. 启用后台管理插件 通过后台管理插件我们可以动态监控mq的流量,创建用户,队列等. ...
随机推荐
- 重复登录Windows远程桌面-Autoit脚本
非常抱歉,我先临时把脚本放上来,具体的说明有时间再更新: 都是做成快捷方式,用鼠标点击的操作 #include <AutoItConstants.au3> ; Open mstsc pro ...
- For Path
/****** Script for SelectTopNRows command from SSMS ******/ DECLARE @table TABLE (姓名 VARCHAR(10),课程 ...
- xmlSerializer属性的使用
学习了XmlAttribute,XmlElement属性的定义和使用. Order类定义 using System; using System.Collections.Generic; using S ...
- picker(拖拽上下拉动的选项)
[b]新版本更新:鼠标上下拖动选择内容:http://hiuman.iteye.com/blog/2353563[/b] (如有错敬请指点,以下是我工作中遇到并且解决的问题) 一开始搜这个内容的时候, ...
- glxgears刷新只有60FPS解决办法
问题原因在于屏幕的垂直同步刷新率的限制,解决办法是关闭垂直同步刷新. 编辑~/.drirc <driconf> <device screen=" driver=" ...
- 将打开的网页以html格式下载到本地
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- DropZone图片上传控件的使用
前台代码: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w ...
- gitlib 安装
参考文件https://www.cnblogs.com/rslai/p/9109624.html
- 【数据库】E-R模型
E-R模型 实体:客观存在并可相互区别的事物称为实体.可以是具体的人.事.物或抽象的概念. 属性:实体所具有的某一特性称为属性.一个实体可以由若干个属性来刻画. 联系:现实世界中事物内部以及事物之间的 ...
- 加密中的salt是啥意思
今天在stackoverflow上查看python的md5的问题,提到,除了简单的加密外,还可以加入一点salt 啥意思?百度一下看到:(https://zhidao.baidu.com/questi ...