ECShop系统后台添加/修改分类时,指定分类所使用的模板文件!

目的:为前台显示分类列表的时候指定特定的分类列表模板

过程:

1、admin/category.asp

 

$cat['style']        = ! empty( $_POST['style'])        ?  trim( $_POST['style'])        : '';

 

前添加一行

 

$cat['template_file']= ! empty( $_POST['template_file'])?  trim( $_POST['template_file']): '';

;有两处!一处在添加分类信息(107行左右),一处在编辑分类信息 (269行左右)

2、admin/templates/category_info.htm

<tr>
        <td  class="label"><a href="javascript:showNotice('noticeGoodsSN');" title="{ $lang.form_notice}"><img src="images/notice.gif" width="16" height="16" border="0" alt="{ $lang.notice_style}"></a>{ $lang.cat_style}:</td>
        <td>
          <input type="text" name="style" value="{ $cat_info.style|escape}" size="40" /> <br />
          <span  class="notice-span" { if  $help_open}style="display:block" { else} style="display:none" {/ if} id="noticeGoodsSN">{ $lang.notice_style}</span>
        </td>
      </tr>

   前添加

<tr>
        <td  class="label"><a href="javascript:showNotice('noticeTemplate');" title="{ $lang.form_notice}"><img src="images/notice.gif" width="16" height="16" border="0" alt="{ $lang.notice_template}"></a>{ $lang.cat_template}:</td>
        <td>
          <input type="text" name="template_file" value="{ $cat_info.template_file|escape}" size="40" /> <br />
          <span  class="notice-span" { if  $help_open}style="display:block" { else} style="display:none" {/ if} id="noticeTemplate">{ $lang.notice_template}</span>
        </td>
      </tr>

3、langeuage/zh_cn/admin/category.php

 

$_LANG['cat_style'] = '分类的样式表文件';

 

之前添加

 

$_LANG['cat_template'] = '分类的模板文件';

 

 

 

$_LANG['notice_style'] = '您可以为每一个商品分类指定一个样式表文件。例如文件存放在 themes 目录下则输入:themes/style.css';

 

之前添加

$_LANG['notice_template'] = '您可以为每一个商品分类指定一个模板文件,请直接输入模板名称。';

 

4、未完待续...(商品页面也可以根据分类来指定特定的模板)

转载于:https://www.cnblogs.com/witrays/archive/2012/02/06/2340322.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值