我想通过magento admin添加标题链接。我知道可以通过XML文件添加/删除它。在我的情况下,管理员必须决定在标题链接中查看链接。对此有任何扩展吗?。
例如:有时管理员想要在标题链接中添加"当天提供" 链接,有时管理员想要删除此链接。还应该有添加/删除选项。
答案 0 :(得分:0)
您可以通过XML添加它,只需进行启用/禁用它的配置设置。
<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>
然后在system.xml
内的模块中创建此设置:
<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>
将[module]
替换为您的模块名称
答案 1 :(得分:0)
转到“管理类别”,在默认类别下添加子类别说“当日报价” 并将“已激活”和“包含在导航菜单中”选项更改为“是”。
保存类别。 清除缓存。 刷新页面以检查更改。
您只需更改“处于活动状态”选项否,即可禁用菜单项“当天的优惠”