【问题标题】:Magento set custom page title and description for sitemap pagesMagento 为站点地图页面设置自定义页面标题和描述
【发布时间】:2013-04-14 10:40:07
【问题描述】:

我正在寻找一种将自定义页面标题和元描述添加到 Magento 默认 catalog/seo_sitemap/category/catalog/seo_sitemap/product/ 页面的方法。

我之前在内置的联系人页面上通过更新contacts.xml文件完成了这项工作:

    <reference name="head">     
        <action method="setDescription"><title>my description here</title></action>
        <action method="setTitle"><title>My title here</title></action>
    </reference>

这绝对没问题。但是,我目前不知道如何将这种技术或类似技术应用于我概述的 2 页。

【问题讨论】:

    标签: magento


    【解决方案1】:

    做同样的事情,但将其应用到catalog.xml 文件中。您还可以使用以下内容设置local.xml

    <?xml version="1.0"?>
    <layout version="0.1.0">
        <catalog_seo_sitemap_category translate="label">
            <reference name="head">
                 <action method="setDescription" module="catalog"><title>Custom description here</title></action>
                 <action method="setTitle" module="catalog"><title>Custom Site Map here</title></action>
            </reference>
        </catalog_seo_sitemap_category>
    </layout>
    

    您可以将相同的方法应用于catalog/seo_sitemap/product/

    【讨论】:

    • 非常感谢您的回答@seanbreeden - 我已经看到更改了 catalog.xml 并实施了一些更改,现在它工作得非常好。再次感谢 - 非常感谢。
    • 我们可以使用它从core_config_value 中获取标题,而不是对字符串进行硬编码吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 1970-01-01
    相关资源
    最近更新 更多