我一直在使用 Kus 在此处找到的答案:
然而,从我的本地移动到测试服务器,看起来该类没有被读取,并且我丢失了上传按钮。
这是我的图像块
<widgetpress_list type="springwidget_press/List" module="springwidget_press">
....
<image>
<label>Press Image</label>
<description>Image to be displayed on the page</description>
<visible>1</visible>
<type>label</type>
<helper_block>
<type>springwidget_press/imagechooser</type>
<data>
<button translate="open">
<open>Insert Image...</open>
</button>
</data>
</helper_block>
</image>
....
</widgetpress_list>
这是我在名为 app/code/local/Spring/Press/Block/ImageChooser.php 的文件中的类名
class Spring_Press_Block_ImageChooser extends Mage_Adminhtml_Block_Template
{
public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
{
.
.
.
}
}
有任何想法吗?