webstermobile
Fork me on GitHub
个人博客

ECSHOP不同商品分类调用不同模板

 1 1.在ecs_category 表 添加 template 字段
 2 可以在后台运行sql语句:alter table `ecs_category` Add column template text NOT NULL AFTER `style`
 3 前缀自己改
 4 2.打开admin/templates/category_info.htm 文件,分类的样式表文件 的下一行,加放以下代码
 5 搜索:javascript:showNotice('noticeGoodsSN') 找到:大概在128行
 6 <tr>
 7     <td class="label">
 8         <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}:
 9     </td>
10     <td>
11       <input type="text" name="style" value="{$cat_info.style|escape}" size="40" /> <br />
12       <span class="notice-span" {if $help_open}style="display:block" {else} style="display:none" {/if} id="noticeGoodsSN">{$lang.notice_style}</span>
13     </td>
14 </tr>
15 下方增加:
16 <tr> 
17     <td class="label">分类模板:</td> 
18     <td> 
19         <input type="text" name="template" value="{$cat_info.template|escape}" size="40" /> <br /> 
20         <span class="notice-span">留空为默认模板</span> 
21     </td> 
22 </tr> 
23 3.打开admin/category.php
24 搜索:$cat['style'] = !empty($_POST['style']) ? trim($_POST['style']) : '';
25 找到 (一共两个地方)
26 在下面加上
27 $cat['template'] = !empty($_POST['template']) ? trim($_POST['template']) : '';
28 4.打开category.php
29 找到  function get_cat_info($cat_id),要在下面的sql语句里找到 cat_desc, style 在后面加上 ,template
30 大概在432行:cat_desc, style, template,  grade,
31 搜索:assign_dynamic('category'); // 动态内容
32 下方找到:$smarty->display('category.dwt', $cache_id);
33 //修改
34 $categorys = $cat['template'] ? $cat['template'] : 'category.dwt';
35 $smarty->display($categorys, $cache_id);

 

posted @ 2015-01-15 15:34  wpindesign  阅读(297)  评论(0编辑  收藏  举报