http://crazyhut.blog.163.com/blog/static/1690924522012321913321/
1,复制文件
index.php->about.php
/themes/default/index.dwt->about.dwt
2,添加后台模板管理->设置模板 里面的 选择模板下拉框选项
\admin\includes\lib_template.php
1)
$template_files = array(
'index.dwt',
添加
'about.dwt',
2)
复制index模板库文件结构到
'about' => 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
),
3)添加说明文字
\languages\zh_cn\admin/template.php
添加加一行
$_LANG['template_files']['about'] = '关于我们模板';
4)添加库文件的引用
themes\default\libs.xml
复制index库引用到
<file name="about.dwt">
<region name="">
<lib>cart</lib>
<lib>category_tree</lib>
<lib>top10</lib>
<lib>promotion_info</lib>
<lib>auction</lib>
<lib>group_buy</lib>
<lib>order_query</lib>
<lib>invoice_query</lib>
<lib>vote_list</lib>
<lib>email_list</lib>
</region>
<region name="վ"/>
<region name="">
<lib>recommend_best</lib>
<lib>recommend_new</lib>
<lib>recommend_hot</lib>
</region>
</file>
3,创建新的库
1)新建库文件
\themes\default\library\目录下新建一个about.lbi文件
2)在对应的模板文件添加库的引用
\admin\includes\lib_template.php文件里面
在新加的'about' => array数组末尾加'/library/about.lbi' => 0
3)添加说明文字
\languages\zh_cn\admin\template.php 里面加入一行
$_LANG['template_libs']['about'] = 'about库文件';
4)添加区域的选择项
\themes\default\libs.xml文件里找到刚才你加的
<file name="about.dwt"><region name="左边区域">里面加上<lib>about</lib>
网上的二次开发教程又多又乱,这篇算比较完整
1,复制文件
index.php->about.php
/themes/default/index.dwt->about.dwt
2,添加后台模板管理->设置模板 里面的 选择模板下拉框选项
\admin\includes\lib_template.php
1)
$template_files = array(
'index.dwt',
添加
'about.dwt',
2)
复制index模板库文件结构到
'about' => 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
),
3)添加说明文字
\languages\zh_cn\admin/template.php
添加加一行
$_LANG['template_files']['about'] = '关于我们模板';
4)添加库文件的引用
themes\default\libs.xml
复制index库引用到
<file name="about.dwt">
<region name="">
<lib>cart</lib>
<lib>category_tree</lib>
<lib>top10</lib>
<lib>promotion_info</lib>
<lib>auction</lib>
<lib>group_buy</lib>
<lib>order_query</lib>
<lib>invoice_query</lib>
<lib>vote_list</lib>
<lib>email_list</lib>
</region>
<region name="վ"/>
<region name="">
<lib>recommend_best</lib>
<lib>recommend_new</lib>
<lib>recommend_hot</lib>
</region>
</file>
3,创建新的库
1)新建库文件
\themes\default\library\目录下新建一个about.lbi文件
2)在对应的模板文件添加库的引用
\admin\includes\lib_template.php文件里面
在新加的'about' => array数组末尾加'/library/about.lbi' => 0
3)添加说明文字
\languages\zh_cn\admin\template.php 里面加入一行
$_LANG['template_libs']['about'] = 'about库文件';
4)添加区域的选择项
\themes\default\libs.xml文件里找到刚才你加的
<file name="about.dwt"><region name="左边区域">里面加上<lib>about</lib>