Magento教程 50:MAGENTO后台管理增加图片上传功能

在制作Magento扩展套件时,我们通常在system.xml宣告该套件在后台的设定栏位,为该套件设定相关的参数以及文字,今天在要教大家如何在system.xml增加图片上传的栏位。

首先先到该套件所在的资料夹位置后编辑etc/system.xml 档案,接着在你欲增加的页签中增加下列程式码

 <example_image>

<label>Example Image</label>

<frontend_type>image</frontend_type>

<backend_mo​​del>adminhtml/system_config_backend_image</backend_mo​​del>

<base_url type="media" scope_info="1″>example</base_url>

<sort_order>40</sort_order>

<show_in_default>1</show_in_default>

<show_in_website>1</show_in_website>

<show_in_store>1</show_in_store>

</example_image>

以下对三个标签特别说明:

<frontend_type> 宣告栏位的属性,本范例

<backend_mo​​del> 此为宣告该栏位使用的模组

<base_url type=”media” scope_info=”1″> 此为宣告上传位置在media中所指定的资料夹

这样一来你就可以从后台管理介面上传图片

Magento教程 50:MAGENTO后台管理增加图片上传功能
Magento教程 50:MAGENTO后台管理增加图片上传功能

 

原文:http://www.astralweb.com.tw/magento-increase-image-upload-feature/

本文:MAGENTO后台管理增加图片上传功能

Loading

Tags:

Add a Comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.