2011-12-11 39 views
1

我已閱讀關於此的教程和論壇帖子,但無論我做什麼,似乎沒有任何區別。Magento 1.6更改搜索佈局

我想將我的搜索結果更改爲1列布局。到目前爲止,我已經嘗試去

應用程序/設計/前端/基/默認/佈局/ catalogsearch.xml

<reference name="root"> 
      <action method="setTemplate"><template>LAYOUT HERE</template></action> 
</reference> 

每個實例更改爲

<reference name="root"> 
      <action method="setTemplate"><template>page/1column.phtml</template></action> 
</reference> 

我禁用了緩存,刷新了它們,刷新了它們,甚至重新編制了索引。

我的主題中沒有一個catalogsearch.xml,可能無法使用它。

任何想法,這是如此令人沮喪。

回答

0

不要更改「基本」主題中的文件。他們會被實際使用的主題覆蓋。傳統和推薦的更改方式是在自定義主題中創建一個local.xml文件並將操作放在該文件中。

+0

你可以把你的代碼更改佈局在1根據你說的列。如果你把你的代碼放在這裏非常好。 –

1

要更改搜索佈局,請嘗試使用活動(默認)模板。

讓我們假設你使用的是默認的Magento於版圖

(1)打開應用程序/設計/前端/預設/默認/佈局/ catalogsearch.xml

<catalogsearch_result_index translate="label"> 

使您的更改爲

<reference name="root"> 
    <action method="setTemplate"><template>page/2columns-left.phtml</template></action> 
</reference> 

(或者您的模板當前設置爲,在r或參考)

您當前的代碼無法工作的原因是因爲默認(活動)模板正在重寫基礎。當Magento更新時,這可以確保基本安全。

編輯*如果您將文件放置在實際的默認模板中,則它們在升級過程中會隨基準一起更換。請確保您有自己的模板文件夾,並根據需要更改local.xml中,而不是catalogsearch.xml -

你local.xml文件,可能是這樣的,如果它是品牌新 -

<?xml version="1.0" encoding="UTF-8"?> 
<layout> 
<default> 
<catalogsearch_result_index translate="label"> 
    <reference name="root"> 
     <action method="setTemplate"><template>page/3columns.phtml</template></action> 
    </reference> 
</catalogsearch_result_index> 
</default> 
</layout> 
0

在/佈局文件夾在我的實際創建主題,用那個local.xml這顯示與2columns左搜索,

<?xml version="1.0" encoding="UTF-8"?> 
<layout> 
<catalogsearch_result_index translate="label"> 
     <reference name="root"> 
      <action method="setTemplate"><template>page/2columns-left.phtml</template></action> 
     </reference> 
</catalogsearch_result_index> 

</layout> 

在Magento曾爲完美1.9.0.1