我想对 catalog/category的布局句柄有一个具体而准确的解释 页。
据我所知,我知道有三种不同的布局句柄:
catalog_category_view
,
catalog_category_default
,
catalog_category_layered
如果我们看一下
Mage_Catalog_Model_Category::getLayoutUpdateHandle()
我们会看到:
public function getLayoutUpdateHandle()
{
$layout = 'catalog_category_';
if ($this->getIsAnchor()) {
$layout .= 'layered';
}
else {
$layout .= 'default';
}
return $layout;
}
所以
catalog_category_layered
当
is_anchor加载
设置为
yes
,否则
catalog_category_default
是谁将被装载。
那么
catalog_category_view
呢
?
在我的情况下,在我的
catalog/product
页面我有
catalog_category_view
作为
layered navigation的布局句柄
如果我把一些类别设置为
is_anchor
是的,我仍然总是有相同的布局
catalog_category_view
?
最新回答
- 2019-12-51 #
- 2019-12-52 #
catalog_category_view
适用于所有类别页面catalog_category_default
仅适用于将锚设置为 no的页面catalog_category_layered
仅适用于将锚设置为 yes的页面
相关问题
- magento 1.9:如何移动类别描述文本?magento1.9magentocategorymagentotemplate2019-12-05 21:44
- magento 1.9:如何使用自定义逻辑扩展adminhtml JavaScript方法?magento1.9magentolayoutmagentoadminhtmlmagento1.14magentothemefallback2019-12-05 21:42
- magento 1.9:在联系我们页面上从左侧删除类别magento1.9magentolayoutmagentourlmagentocontactus2019-12-05 21:39
- magento 1.9:可配置产品显示以下缺货产品magento1.9magentocategorymagentoconfigurableproductmagentoposition2019-12-05 21:43
- magento 1.9:类别仅在登录和注销后可见?magento1.9magentocategorymagentoproductlist2019-12-05 21:41
你应该有类别页面的多个句柄(肯定超过5个).如果您想知道哪个句柄用于特定页面,您可以在页面模板中添加以下代码:
(例如在
app/design/frontend/<your-package>/<your-theme>/template/catalog/category/view.phtml
模板)catalog_category_view
应始终存在于类别页面中,因为对于控制器的每个操作,Magento将创建一个名为routerName_controllerName_actionName
的句柄 (当你在类别页面时调用的动作是viewAction()
categoryController.php
Mage_Catalog
模块 有路由器名称catalog
)。如果使用
is_anchor
设置了类别 是的,它应该添加另一个句柄catalog_category_layered
正如你提到的那样。希望它会有所帮助。