【发布时间】:2012-11-29 23:24:07
【问题描述】:
我正在尝试在 Opencart 1.5.4 中设置其他页面和类别布局。
我已经到了一个阶段,如果我在地址栏中输入新类别的路线,新模板会按我的意愿显示,但我似乎无法在 OC 中注册该路线更改。
如果我在 .htaccess 文件中指定更改,新模板会按预期加载,但我认为这不是问题的正确答案(尽管它有效)。
.htaccess 的补充(我确定方法不正确)
RewriteRule ^skis$ index.php?route=product/categories&path=1 [L,QSA]
我创建了两个新文件
/catalog/view/theme/default/template/product/categories.tpl
/catalog/controller/product/categories.php
在 /catalog/controller/product/categories.php 中,我已更改内容以反映新的 tpl 文件;
class Controllerproductcategories extends Controller {
.
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/categories.tpl')) {
$this->template = $this->config->get('config_template') . '/template/product/categories.tpl';
} else {
$this->template = 'default/template/product/categories.tpl';
}
总结一下
- 如果我在布局加载的 .htaccess 文件中指定重写,否则不会。
- 我在 OC 中添加了一个新布局,并针对类别 选择了它
任何人有任何想法我可以尝试让它正常工作吗?我有大量模板要为产品、类别和信息页面创建,因此希望能正确执行此操作。
提前发送
学习
【问题讨论】:
标签: opencart