2011-12-11 38 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