Images in Magento widgets

前端 未结 6 2232
無奈伤痛
無奈伤痛 2020-12-31 21:33

I am developing a site for a fashion client in Magento Community version 1.4.2 and as part of this project I need to have some customized home page promotion blocks to featu

6条回答
  •  耶瑟儿~
    2020-12-31 22:00

    I solved this use case by creating a custom field type for widgets:

    
        
        Promotion image
        1
        widgetimagechooser/chooser
    
    

    I implemented a block Aijko_WidgetImageChooser_Block_Chooser that triggers the standard Magento image chooser element.

    To solve the problem with the non clear url to the image file I implemented a custom controller Aijko_WidgetImageChooser_Adminhtml_Cms_Wysiwyg_Images_ChooserController that handles the return value from the Magento standard image chooser.

    The value is added to a textbox in the widget. This relative url to the image then can be used to show the image in the frontend.

    Feel free to try the extension available on Github or install directly using Magento Connect.

提交回复
热议问题