【问题标题】:Display image in system configuration in magento?在magento的系统配置中显示图像?
【发布时间】:2013-09-18 13:38:01
【问题描述】:

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

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

帮我做这件事。

谢谢

【问题讨论】:

  • 您能否更具体一些并提供您尝试过的示例?谢谢!

标签: magento configuration magento-1.7 system.xml


【解决方案1】:

如果我理解正确,您需要在 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'); ?>

【讨论】:

  • 我不想从系统中获取图像(上传选项)。需要从我的系统中显示图像。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-10-08
  • 1970-01-01
  • 2012-12-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-06-24
相关资源
最近更新 更多