Magento自定义目录搜索结果html [英] Magento customize catalogsearch result html

查看:104
本文介绍了Magento自定义目录搜索结果html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想定制CatalogSearch结果页面的布局。



我想删除页面上的分页和所有其他工具,并显示因为我们只有很少的产品,所以这个页面要简单得多。然后我需要改变显示结果的方式来定制图像的大小并在图像上添加翻转。



我该怎么做?
通过查看源代码,它调用 $ this-> getProductListHtml()

解决方案

确定要编辑哪些模板文件的最简单方法是在Magento配置中启用模板路径提示。



为此,请执行以下操作:


  1. Magento Admin,进入系统>配置>开发者


  2. 当前配置范围 ,请选择主要网站(或您尝试修改的网站的名称)。


  3. 现在在右侧,然后点击保存配置

    你的前端。现在每个部分都会显示您需要修改的确切模板。




  4. 或者,您可以使用CSS定位Magento中的每个页面。 Magento为每个页面的< body> 标签赋予一个唯一的类别。



    在您的情况下,Catalog Search Results页面具有 catalogsearch-result-index 的主体类。如果您想在该页面上隐藏工具栏,可以将以下内容添加到模板的style.css文件中:

      .catalogsearch -result-index .toolbar {
    display:none;
    }


    I'd like to customize the layout for the result page of CatalogSearch.

    I'd like to remove the pagination and all other tools on the page and show a much simpler page since we only have few products. Then I need to change how results are displayed to customize the size of images and add a rollover on images.

    How can I do that? By looking at the source code it calls $this->getProductListHtml().

    解决方案

    The easiest way to determine which template files to edit, is to enable the "Template Path Hints" in your Magento Configuration.

    To do this, do the following:

    1. In your Magento Admin, go to System > Configuration > Developer

    2. On the top left under Current Configuration Scope, select Main Website (or the name of the site you are trying to modify.)

    3. Now on the right, set Template Path Hints to Yes and click Save Config

    4. Go back to your frontend. Each section will now display the exact template you need to modify. NOTE: You should always copy the default template files to your own template directory, instead of modifying Magento's core theme.


    Alternately, you can target each page in Magento using CSS. Magento assigns a unique class to each page's <body> tag

    In your case, the Catalog Search Results page has a body class of catalogsearch-result-index. If you want to hide the toolbar on that page, you can add the following to your template's style.css file:

    .catalogsearch-result-index .toolbar {
       display: none;
    }
    

    这篇关于Magento自定义目录搜索结果html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆