gpt4 book ai didi

magento - 在 magento 的系统配置中显示图像?

转载 作者:行者123 更新时间:2023-12-04 04:41:12 26 4
gpt4 key购买 nike

我想在系统配置中显示单选按钮值的图像。

我也想在我的前端显示选定的图像。

帮我做这件事。

谢谢

最佳答案

如果我理解正确,您需要在 system.xml 的后端选择图像:

<config>
<sections>
<section_name>
<groups>
<group_name>
<fields>
<logoimage translate="label comment">
<label>Logo</label>
<frontend_type>image</frontend_type>
<backend_model>adminhtml/system_config_backend_image</backend_model>
<upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
<base_url type="media" scope_info="1">theme</base_url>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</logoimage>
</fields>
</group_name>
</groups>
</section_name>
</sections>
</config>

然后粘贴在前端:
<?php echo Mage::getBaseUrl('media') . Mage::getStoreConfig('section_name/group_name/logoimage'); ?>

关于magento - 在 magento 的系统配置中显示图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18873774/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com