dongxing4643 2014-04-16 07:02
浏览 35

通过magento admin添加标题链接

I want to Add header links via magento admin.I know it can be added/removed via XML files. In my case, admin must decide Links to be viewed in header links. Is there any extensions to to this?.

For Example: Sometime admin wants to add "Offer of the day" link in header links, sometime admin wants to remove this link. Also there should be option to add/remove.

  • 写回答

2条回答 默认 最新

  • donjd86266 2014-04-16 08:16
    关注

    You can add it through XML and just make a config setting that enables/disables it.

    <default>
        <reference name="top.links">
            <action method="addLink" translate="label title" module="[module]" ifconfig="[module]/offer/enabled">
                <label>Offer of the day</label>
                <url>URL HERE</url>
                <title>Offer of the day</title>
                <prepare/>
                <urlParams/>
                <position>100</position>
             </action>
        </reference>
    </default>
    

    Then create in your module inside system.xml this setting:

    <config>
        <sections>
            <[module] translate="label" module="[module]">
                <label>[Module]</label>
                <tab>general</tab>
                <frontend_type>text</frontend_type>
                <sort_order>1000</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>
                <groups>
                    <offer translate="label">
                        <label>Offer of the day</label>
                        <frontend_type>text</frontend_type>
                        <sort_order>10</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                        <fields>
                            <enabled translate="label">
                                <label>Enable</label>
                                <frontend_type>select</frontend_type>
                                <source_model>adminhtml/system_config_source_yesno</source_model>
                                <sort_order>10</sort_order>
                                <show_in_default>1</show_in_default>
                                <show_in_website>1</show_in_website>
                                <show_in_store>1</show_in_store>
                            </enabled>
                        </fields>
                    </offer>
                </groups>
            </[module]>
        </sections>
    </config>
    

    Replace [module] with your module name

    评论

报告相同问题?

悬赏问题

  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制