app/design/frontend/default/default/layout/catalog.xml を開く
要件に応じて列数を定義します
の
<catalog_category_default>,<catalog_category_layered>
また
列数を設定したい場合<catalogsearch_result_index>
で開いて編集する
開いたapp/design/frontend/default/default/layout/catalogsearch.xml
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>4</count></action>
<action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
<action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
オブザーバーを定義する
app/code/core/Mage/Catalog/etc/config.xml
次のコードを追加します<events>
<catalog_controller_category_init_after>
<observers>
<custom_page_layout>
<class>catalog/observer</class>
<method>addHandle</method>
</custom_page_layout>
</observers>
</catalog_controller_category_init_after>
開催中
app/code/core/Mage/Catalog/Model/Observer.php
次の関数を追加します
public function addHandle($observer)
{
$controllerAction = $observer->getEvent()->getControllerAction();
$category = $observer->getEvent()->getCategory();
if ($category->getPageLayout()) {
$controllerAction->getLayout()->helper('page/layout')
->applyHandle($category->getPageLayout());
}
}
管理者に移動
2) カタログ -> カテゴリの管理
3) 1列レイアウトにしたいカテゴリを選択
4) カスタムデザインをクリック
5) 親カテゴリ設定を使用 = ページ レイアウトなし = 1 列
注:コアで編集する代わりに、新しいモジュールを作成し、オブザーバーの上に定義します
これがあなたを助けることを願っています