Custom widget image is not showing on frontend Magento 2Magento 2 Widget With Image ChooserImage in widget magento 2.1Magento 2 : Problem while adding custom button order view page?Error with Dependency Injection in widgetMagento 2 Add new field to Magento_User admin formMagento offline custom Payment method with drop down listShow category image in widgetMagento 2 Create dynamic array From different Model Collection to use in multi select in gridCategory and sub category image widgetMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?MsrpPriceCalculator Exception

What's the correct term for a waitress in the Middle Ages?

Will TSA allow me to carry a Continuous Positive Airway Pressure (CPAP) device?

Get value of the passed argument to script importing variables from another script

Short story written from alien perspective with this line: "It's too bright to look at, so they don't"

What does War Machine's "Canopy! Canopy!" line mean in "Avengers: Endgame"?

Comma Code - Ch. 4 Automate the Boring Stuff

Setting extra bits in a bool makes it true and false at the same time

How can I add depth to my story or how do I determine if my story already has depth?

How to provide realism without making readers think grimdark

Could the Missouri River be running while Lake Michigan was frozen several meters deep?

How can I grammatically understand "Wir über uns"?

What happens to foam insulation board after you pour concrete slab?

How to decline physical affection from a child whose parents are pressuring them?

Do marked cards or loaded dice have any mechanical benefit?

Can a magnetic field of a large body be stronger than its gravity?

pitch and volume compensations for different instruments

How can a single Member of the House block a Congressional bill?

PhD student with mental health issues and bad performance

Is it OK to bring delicacies from hometown as tokens of gratitude for an out-of-town interview?

Do adult Russians normally hand-write Cyrillic as cursive or as block letters?

California: "For quality assurance, this phone call is being recorded"

What if you don't bring your credit card or debit for incidentals?

Unorthodox way of solving Einstein field equations

Working in the USA for living expenses only; allowed on VWP?



Custom widget image is not showing on frontend Magento 2


Magento 2 Widget With Image ChooserImage in widget magento 2.1Magento 2 : Problem while adding custom button order view page?Error with Dependency Injection in widgetMagento 2 Add new field to Magento_User admin formMagento offline custom Payment method with drop down listShow category image in widgetMagento 2 Create dynamic array From different Model Collection to use in multi select in gridCategory and sub category image widgetMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?MsrpPriceCalculator Exception






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I have a custom widget with an image uploader. Backend is working perfectly, but uploaded image path is showing like this http://db7005.web49.ixl.nu/achterkant/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvZHJ3LWNvbGxlY3RpZS5qcGcifX0,/key/41232ece1b5fc0b9dda248a7e185407a69cbda1f653169244448d6c38e0abdcc/



My image is not showing on frontend. Can anyone please help me to solve this issue.



enter image description here



CookiecodeWidgetBlocketcwidget.xml



<?xml version="1.0" encoding="UTF-8"?>

<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
<widget id="cc_custom_widget" class="CookiecodeWidgetBlockBlockWidgetCustomWidget" placeholder_image="Cookiecode_WidgetBlock::images/widget_block.png">
<label translate="true">Cookiecode - Custom block widget</label>
<description>Cookiecode - Demo Block widget</description>
<parameters>
<parameter name="cc_text1" xsi:type="text" visible="true" required="true" sort_order="0" >
<label translate="true">Text1</label>
</parameter>
<parameter name="cc_text2" xsi:type="text" visible="true" required="true" sort_order="0" >
<label translate="true">Text2</label>
</parameter>
<parameter name="cc_text3" xsi:type="text" visible="true" required="true" sort_order="0" >
<label translate="true">Text3</label>
</parameter>
<parameter name="cc_text4" xsi:type="text" visible="true" required="true" sort_order="0" >
<label translate="true">Text4</label>
</parameter>
<parameter name="image1" xsi:type="block" required="true" visible="true" sort_order="10">
<label translate="true">Image1</label>
<block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
<data>
<item name="button" xsi:type="array">
<item name="open" xsi:type="string">Choose Image...</item>
</item>
</data>
</block>
</parameter>
<parameter name="image2" xsi:type="block" required="true" visible="true" sort_order="10">
<label translate="true">Image2</label>
<block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
<data>
<item name="button" xsi:type="array">
<item name="open" xsi:type="string">Choose Image...</item>
</item>
</data>
</block>
</parameter>
<parameter name="image3" xsi:type="block" required="true" visible="true" sort_order="10">
<label translate="true">Image3</label>
<block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
<data>
<item name="button" xsi:type="array">
<item name="open" xsi:type="string">Choose Image...</item>
</item>
</data>
</block>
</parameter>
<parameter name="image4" xsi:type="block" required="true" visible="true" sort_order="10">
<label translate="true">Image4</label>
<block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
<data>
<item name="button" xsi:type="array">
<item name="open" xsi:type="string">Choose Image...</item>
</item>
</data>
</block>
</parameter>
<parameter name="cc_url1" xsi:type="text" visible="true" sort_order="30">
<label translate="true">URL1</label>
</parameter>
<parameter name="cc_url2" xsi:type="text" visible="true" sort_order="31">
<label translate="true">URL2</label>
</parameter>
<parameter name="cc_url3" xsi:type="text" visible="true" sort_order="32">
<label translate="true">URL3</label>
</parameter>
<parameter name="cc_url4" xsi:type="text" visible="true" sort_order="33">
<label translate="true">URL4</label>
</parameter>
</parameters>
</widget>
</widgets>


CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser.php



<?php
namespace CookiecodeWidgetBlockBlockAdminhtmlWidget;
class ImageChooser extends MagentoBackendBlockTemplate

/**
* @var MagentoFrameworkDataFormElementFactory
*/
protected $_elementFactory;
/**
* @param MagentoBackendBlockTemplateContext $context
* @param MagentoFrameworkDataFormElementFactory $elementFactory
* @param array $data
*/
public function __construct(
MagentoBackendBlockTemplateContext $context,
MagentoFrameworkDataFormElementFactory $elementFactory,
array $data = []
)
$this->_elementFactory = $elementFactory;
parent::__construct($context, $data);

/**
* Prepare chooser element HTML
*
* @param MagentoFrameworkDataFormElementAbstractElement $element Form Element
* @return MagentoFrameworkDataFormElementAbstractElement
*/
public function prepareElementHtml(MagentoFrameworkDataFormElementAbstractElement $element)

$config = $this->_getData('config');
$sourceUrl = $this->getUrl('cms/wysiwyg_images/index',
['target_element_id' => $element->getId(), 'type' => 'file']);
$chooser = $this->getLayout()->createBlock('MagentoBackendBlockWidgetButton')
->setType('button')
->setClass('btn-chooser')
->setLabel($config['button']['open'])
->setOnClick('MediabrowserUtility.openDialog(''. $sourceUrl .'')')
->setDisabled($element->getReadonly());
$input = $this->_elementFactory->create("text", ['data' => $element->getData()]);
$input->setId($element->getId());
$input->setForm($element->getForm());
$input->setClass("widget-option input-text admin__control-text");
if ($element->getRequired())
$input->addClass('required-entry');

$element->setData('after_element_html', $input->getElementHtml() . $chooser->toHtml());
return $element;




appcodeCookiecodeWidgetBlockviewfrontendtemplateswidgetcustom_widget.phtml



<div class="cc-custom-widget">
<?php $cc_url1 = $this->getData('cc_url1') ?>
<?php $cc_text1 = $this->getData('cc_text1') ?>
<?php $cc_image = $this->getData('image2') ?>
</div>
<div class="row">
<div class="medium-up-4" data-equalizer="">
<div class="column drw-home text-center">
<div class="wrapper"><a href="<?php echo $cc_url1 ?>"><span data-equalizer-watch=""><img src="<?php echo $cc_image ?>"/><?php echo $cc_text1 ?></span></a></div>
</div>
</div>
</div>









share|improve this question






























    3















    I have a custom widget with an image uploader. Backend is working perfectly, but uploaded image path is showing like this http://db7005.web49.ixl.nu/achterkant/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvZHJ3LWNvbGxlY3RpZS5qcGcifX0,/key/41232ece1b5fc0b9dda248a7e185407a69cbda1f653169244448d6c38e0abdcc/



    My image is not showing on frontend. Can anyone please help me to solve this issue.



    enter image description here



    CookiecodeWidgetBlocketcwidget.xml



    <?xml version="1.0" encoding="UTF-8"?>

    <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
    <widget id="cc_custom_widget" class="CookiecodeWidgetBlockBlockWidgetCustomWidget" placeholder_image="Cookiecode_WidgetBlock::images/widget_block.png">
    <label translate="true">Cookiecode - Custom block widget</label>
    <description>Cookiecode - Demo Block widget</description>
    <parameters>
    <parameter name="cc_text1" xsi:type="text" visible="true" required="true" sort_order="0" >
    <label translate="true">Text1</label>
    </parameter>
    <parameter name="cc_text2" xsi:type="text" visible="true" required="true" sort_order="0" >
    <label translate="true">Text2</label>
    </parameter>
    <parameter name="cc_text3" xsi:type="text" visible="true" required="true" sort_order="0" >
    <label translate="true">Text3</label>
    </parameter>
    <parameter name="cc_text4" xsi:type="text" visible="true" required="true" sort_order="0" >
    <label translate="true">Text4</label>
    </parameter>
    <parameter name="image1" xsi:type="block" required="true" visible="true" sort_order="10">
    <label translate="true">Image1</label>
    <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
    <data>
    <item name="button" xsi:type="array">
    <item name="open" xsi:type="string">Choose Image...</item>
    </item>
    </data>
    </block>
    </parameter>
    <parameter name="image2" xsi:type="block" required="true" visible="true" sort_order="10">
    <label translate="true">Image2</label>
    <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
    <data>
    <item name="button" xsi:type="array">
    <item name="open" xsi:type="string">Choose Image...</item>
    </item>
    </data>
    </block>
    </parameter>
    <parameter name="image3" xsi:type="block" required="true" visible="true" sort_order="10">
    <label translate="true">Image3</label>
    <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
    <data>
    <item name="button" xsi:type="array">
    <item name="open" xsi:type="string">Choose Image...</item>
    </item>
    </data>
    </block>
    </parameter>
    <parameter name="image4" xsi:type="block" required="true" visible="true" sort_order="10">
    <label translate="true">Image4</label>
    <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
    <data>
    <item name="button" xsi:type="array">
    <item name="open" xsi:type="string">Choose Image...</item>
    </item>
    </data>
    </block>
    </parameter>
    <parameter name="cc_url1" xsi:type="text" visible="true" sort_order="30">
    <label translate="true">URL1</label>
    </parameter>
    <parameter name="cc_url2" xsi:type="text" visible="true" sort_order="31">
    <label translate="true">URL2</label>
    </parameter>
    <parameter name="cc_url3" xsi:type="text" visible="true" sort_order="32">
    <label translate="true">URL3</label>
    </parameter>
    <parameter name="cc_url4" xsi:type="text" visible="true" sort_order="33">
    <label translate="true">URL4</label>
    </parameter>
    </parameters>
    </widget>
    </widgets>


    CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser.php



    <?php
    namespace CookiecodeWidgetBlockBlockAdminhtmlWidget;
    class ImageChooser extends MagentoBackendBlockTemplate

    /**
    * @var MagentoFrameworkDataFormElementFactory
    */
    protected $_elementFactory;
    /**
    * @param MagentoBackendBlockTemplateContext $context
    * @param MagentoFrameworkDataFormElementFactory $elementFactory
    * @param array $data
    */
    public function __construct(
    MagentoBackendBlockTemplateContext $context,
    MagentoFrameworkDataFormElementFactory $elementFactory,
    array $data = []
    )
    $this->_elementFactory = $elementFactory;
    parent::__construct($context, $data);

    /**
    * Prepare chooser element HTML
    *
    * @param MagentoFrameworkDataFormElementAbstractElement $element Form Element
    * @return MagentoFrameworkDataFormElementAbstractElement
    */
    public function prepareElementHtml(MagentoFrameworkDataFormElementAbstractElement $element)

    $config = $this->_getData('config');
    $sourceUrl = $this->getUrl('cms/wysiwyg_images/index',
    ['target_element_id' => $element->getId(), 'type' => 'file']);
    $chooser = $this->getLayout()->createBlock('MagentoBackendBlockWidgetButton')
    ->setType('button')
    ->setClass('btn-chooser')
    ->setLabel($config['button']['open'])
    ->setOnClick('MediabrowserUtility.openDialog(''. $sourceUrl .'')')
    ->setDisabled($element->getReadonly());
    $input = $this->_elementFactory->create("text", ['data' => $element->getData()]);
    $input->setId($element->getId());
    $input->setForm($element->getForm());
    $input->setClass("widget-option input-text admin__control-text");
    if ($element->getRequired())
    $input->addClass('required-entry');

    $element->setData('after_element_html', $input->getElementHtml() . $chooser->toHtml());
    return $element;




    appcodeCookiecodeWidgetBlockviewfrontendtemplateswidgetcustom_widget.phtml



    <div class="cc-custom-widget">
    <?php $cc_url1 = $this->getData('cc_url1') ?>
    <?php $cc_text1 = $this->getData('cc_text1') ?>
    <?php $cc_image = $this->getData('image2') ?>
    </div>
    <div class="row">
    <div class="medium-up-4" data-equalizer="">
    <div class="column drw-home text-center">
    <div class="wrapper"><a href="<?php echo $cc_url1 ?>"><span data-equalizer-watch=""><img src="<?php echo $cc_image ?>"/><?php echo $cc_text1 ?></span></a></div>
    </div>
    </div>
    </div>









    share|improve this question


























      3












      3








      3








      I have a custom widget with an image uploader. Backend is working perfectly, but uploaded image path is showing like this http://db7005.web49.ixl.nu/achterkant/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvZHJ3LWNvbGxlY3RpZS5qcGcifX0,/key/41232ece1b5fc0b9dda248a7e185407a69cbda1f653169244448d6c38e0abdcc/



      My image is not showing on frontend. Can anyone please help me to solve this issue.



      enter image description here



      CookiecodeWidgetBlocketcwidget.xml



      <?xml version="1.0" encoding="UTF-8"?>

      <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
      <widget id="cc_custom_widget" class="CookiecodeWidgetBlockBlockWidgetCustomWidget" placeholder_image="Cookiecode_WidgetBlock::images/widget_block.png">
      <label translate="true">Cookiecode - Custom block widget</label>
      <description>Cookiecode - Demo Block widget</description>
      <parameters>
      <parameter name="cc_text1" xsi:type="text" visible="true" required="true" sort_order="0" >
      <label translate="true">Text1</label>
      </parameter>
      <parameter name="cc_text2" xsi:type="text" visible="true" required="true" sort_order="0" >
      <label translate="true">Text2</label>
      </parameter>
      <parameter name="cc_text3" xsi:type="text" visible="true" required="true" sort_order="0" >
      <label translate="true">Text3</label>
      </parameter>
      <parameter name="cc_text4" xsi:type="text" visible="true" required="true" sort_order="0" >
      <label translate="true">Text4</label>
      </parameter>
      <parameter name="image1" xsi:type="block" required="true" visible="true" sort_order="10">
      <label translate="true">Image1</label>
      <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
      <data>
      <item name="button" xsi:type="array">
      <item name="open" xsi:type="string">Choose Image...</item>
      </item>
      </data>
      </block>
      </parameter>
      <parameter name="image2" xsi:type="block" required="true" visible="true" sort_order="10">
      <label translate="true">Image2</label>
      <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
      <data>
      <item name="button" xsi:type="array">
      <item name="open" xsi:type="string">Choose Image...</item>
      </item>
      </data>
      </block>
      </parameter>
      <parameter name="image3" xsi:type="block" required="true" visible="true" sort_order="10">
      <label translate="true">Image3</label>
      <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
      <data>
      <item name="button" xsi:type="array">
      <item name="open" xsi:type="string">Choose Image...</item>
      </item>
      </data>
      </block>
      </parameter>
      <parameter name="image4" xsi:type="block" required="true" visible="true" sort_order="10">
      <label translate="true">Image4</label>
      <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
      <data>
      <item name="button" xsi:type="array">
      <item name="open" xsi:type="string">Choose Image...</item>
      </item>
      </data>
      </block>
      </parameter>
      <parameter name="cc_url1" xsi:type="text" visible="true" sort_order="30">
      <label translate="true">URL1</label>
      </parameter>
      <parameter name="cc_url2" xsi:type="text" visible="true" sort_order="31">
      <label translate="true">URL2</label>
      </parameter>
      <parameter name="cc_url3" xsi:type="text" visible="true" sort_order="32">
      <label translate="true">URL3</label>
      </parameter>
      <parameter name="cc_url4" xsi:type="text" visible="true" sort_order="33">
      <label translate="true">URL4</label>
      </parameter>
      </parameters>
      </widget>
      </widgets>


      CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser.php



      <?php
      namespace CookiecodeWidgetBlockBlockAdminhtmlWidget;
      class ImageChooser extends MagentoBackendBlockTemplate

      /**
      * @var MagentoFrameworkDataFormElementFactory
      */
      protected $_elementFactory;
      /**
      * @param MagentoBackendBlockTemplateContext $context
      * @param MagentoFrameworkDataFormElementFactory $elementFactory
      * @param array $data
      */
      public function __construct(
      MagentoBackendBlockTemplateContext $context,
      MagentoFrameworkDataFormElementFactory $elementFactory,
      array $data = []
      )
      $this->_elementFactory = $elementFactory;
      parent::__construct($context, $data);

      /**
      * Prepare chooser element HTML
      *
      * @param MagentoFrameworkDataFormElementAbstractElement $element Form Element
      * @return MagentoFrameworkDataFormElementAbstractElement
      */
      public function prepareElementHtml(MagentoFrameworkDataFormElementAbstractElement $element)

      $config = $this->_getData('config');
      $sourceUrl = $this->getUrl('cms/wysiwyg_images/index',
      ['target_element_id' => $element->getId(), 'type' => 'file']);
      $chooser = $this->getLayout()->createBlock('MagentoBackendBlockWidgetButton')
      ->setType('button')
      ->setClass('btn-chooser')
      ->setLabel($config['button']['open'])
      ->setOnClick('MediabrowserUtility.openDialog(''. $sourceUrl .'')')
      ->setDisabled($element->getReadonly());
      $input = $this->_elementFactory->create("text", ['data' => $element->getData()]);
      $input->setId($element->getId());
      $input->setForm($element->getForm());
      $input->setClass("widget-option input-text admin__control-text");
      if ($element->getRequired())
      $input->addClass('required-entry');

      $element->setData('after_element_html', $input->getElementHtml() . $chooser->toHtml());
      return $element;




      appcodeCookiecodeWidgetBlockviewfrontendtemplateswidgetcustom_widget.phtml



      <div class="cc-custom-widget">
      <?php $cc_url1 = $this->getData('cc_url1') ?>
      <?php $cc_text1 = $this->getData('cc_text1') ?>
      <?php $cc_image = $this->getData('image2') ?>
      </div>
      <div class="row">
      <div class="medium-up-4" data-equalizer="">
      <div class="column drw-home text-center">
      <div class="wrapper"><a href="<?php echo $cc_url1 ?>"><span data-equalizer-watch=""><img src="<?php echo $cc_image ?>"/><?php echo $cc_text1 ?></span></a></div>
      </div>
      </div>
      </div>









      share|improve this question
















      I have a custom widget with an image uploader. Backend is working perfectly, but uploaded image path is showing like this http://db7005.web49.ixl.nu/achterkant/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvZHJ3LWNvbGxlY3RpZS5qcGcifX0,/key/41232ece1b5fc0b9dda248a7e185407a69cbda1f653169244448d6c38e0abdcc/



      My image is not showing on frontend. Can anyone please help me to solve this issue.



      enter image description here



      CookiecodeWidgetBlocketcwidget.xml



      <?xml version="1.0" encoding="UTF-8"?>

      <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
      <widget id="cc_custom_widget" class="CookiecodeWidgetBlockBlockWidgetCustomWidget" placeholder_image="Cookiecode_WidgetBlock::images/widget_block.png">
      <label translate="true">Cookiecode - Custom block widget</label>
      <description>Cookiecode - Demo Block widget</description>
      <parameters>
      <parameter name="cc_text1" xsi:type="text" visible="true" required="true" sort_order="0" >
      <label translate="true">Text1</label>
      </parameter>
      <parameter name="cc_text2" xsi:type="text" visible="true" required="true" sort_order="0" >
      <label translate="true">Text2</label>
      </parameter>
      <parameter name="cc_text3" xsi:type="text" visible="true" required="true" sort_order="0" >
      <label translate="true">Text3</label>
      </parameter>
      <parameter name="cc_text4" xsi:type="text" visible="true" required="true" sort_order="0" >
      <label translate="true">Text4</label>
      </parameter>
      <parameter name="image1" xsi:type="block" required="true" visible="true" sort_order="10">
      <label translate="true">Image1</label>
      <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
      <data>
      <item name="button" xsi:type="array">
      <item name="open" xsi:type="string">Choose Image...</item>
      </item>
      </data>
      </block>
      </parameter>
      <parameter name="image2" xsi:type="block" required="true" visible="true" sort_order="10">
      <label translate="true">Image2</label>
      <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
      <data>
      <item name="button" xsi:type="array">
      <item name="open" xsi:type="string">Choose Image...</item>
      </item>
      </data>
      </block>
      </parameter>
      <parameter name="image3" xsi:type="block" required="true" visible="true" sort_order="10">
      <label translate="true">Image3</label>
      <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
      <data>
      <item name="button" xsi:type="array">
      <item name="open" xsi:type="string">Choose Image...</item>
      </item>
      </data>
      </block>
      </parameter>
      <parameter name="image4" xsi:type="block" required="true" visible="true" sort_order="10">
      <label translate="true">Image4</label>
      <block class="CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser">
      <data>
      <item name="button" xsi:type="array">
      <item name="open" xsi:type="string">Choose Image...</item>
      </item>
      </data>
      </block>
      </parameter>
      <parameter name="cc_url1" xsi:type="text" visible="true" sort_order="30">
      <label translate="true">URL1</label>
      </parameter>
      <parameter name="cc_url2" xsi:type="text" visible="true" sort_order="31">
      <label translate="true">URL2</label>
      </parameter>
      <parameter name="cc_url3" xsi:type="text" visible="true" sort_order="32">
      <label translate="true">URL3</label>
      </parameter>
      <parameter name="cc_url4" xsi:type="text" visible="true" sort_order="33">
      <label translate="true">URL4</label>
      </parameter>
      </parameters>
      </widget>
      </widgets>


      CookiecodeWidgetBlockBlockAdminhtmlWidgetImageChooser.php



      <?php
      namespace CookiecodeWidgetBlockBlockAdminhtmlWidget;
      class ImageChooser extends MagentoBackendBlockTemplate

      /**
      * @var MagentoFrameworkDataFormElementFactory
      */
      protected $_elementFactory;
      /**
      * @param MagentoBackendBlockTemplateContext $context
      * @param MagentoFrameworkDataFormElementFactory $elementFactory
      * @param array $data
      */
      public function __construct(
      MagentoBackendBlockTemplateContext $context,
      MagentoFrameworkDataFormElementFactory $elementFactory,
      array $data = []
      )
      $this->_elementFactory = $elementFactory;
      parent::__construct($context, $data);

      /**
      * Prepare chooser element HTML
      *
      * @param MagentoFrameworkDataFormElementAbstractElement $element Form Element
      * @return MagentoFrameworkDataFormElementAbstractElement
      */
      public function prepareElementHtml(MagentoFrameworkDataFormElementAbstractElement $element)

      $config = $this->_getData('config');
      $sourceUrl = $this->getUrl('cms/wysiwyg_images/index',
      ['target_element_id' => $element->getId(), 'type' => 'file']);
      $chooser = $this->getLayout()->createBlock('MagentoBackendBlockWidgetButton')
      ->setType('button')
      ->setClass('btn-chooser')
      ->setLabel($config['button']['open'])
      ->setOnClick('MediabrowserUtility.openDialog(''. $sourceUrl .'')')
      ->setDisabled($element->getReadonly());
      $input = $this->_elementFactory->create("text", ['data' => $element->getData()]);
      $input->setId($element->getId());
      $input->setForm($element->getForm());
      $input->setClass("widget-option input-text admin__control-text");
      if ($element->getRequired())
      $input->addClass('required-entry');

      $element->setData('after_element_html', $input->getElementHtml() . $chooser->toHtml());
      return $element;




      appcodeCookiecodeWidgetBlockviewfrontendtemplateswidgetcustom_widget.phtml



      <div class="cc-custom-widget">
      <?php $cc_url1 = $this->getData('cc_url1') ?>
      <?php $cc_text1 = $this->getData('cc_text1') ?>
      <?php $cc_image = $this->getData('image2') ?>
      </div>
      <div class="row">
      <div class="medium-up-4" data-equalizer="">
      <div class="column drw-home text-center">
      <div class="wrapper"><a href="<?php echo $cc_url1 ?>"><span data-equalizer-watch=""><img src="<?php echo $cc_image ?>"/><?php echo $cc_text1 ?></span></a></div>
      </div>
      </div>
      </div>






      magento2 image widget






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 16 '16 at 10:06









      Payal Patel

      1,0291033




      1,0291033










      asked Sep 16 '16 at 9:54









      KeerthanaKeerthana

      169320




      169320




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Did you manage to solve this?
          It seems your problem is that there is a backend url to the image used in the frontend.



          As a workaround you could manually convert the url to a direct link to the image as shown in this interceptor:
          https://magento.stackexchange.com/a/135233/44090






          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f136705%2fcustom-widget-image-is-not-showing-on-frontend-magento-2%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Did you manage to solve this?
            It seems your problem is that there is a backend url to the image used in the frontend.



            As a workaround you could manually convert the url to a direct link to the image as shown in this interceptor:
            https://magento.stackexchange.com/a/135233/44090






            share|improve this answer





























              0














              Did you manage to solve this?
              It seems your problem is that there is a backend url to the image used in the frontend.



              As a workaround you could manually convert the url to a direct link to the image as shown in this interceptor:
              https://magento.stackexchange.com/a/135233/44090






              share|improve this answer



























                0












                0








                0







                Did you manage to solve this?
                It seems your problem is that there is a backend url to the image used in the frontend.



                As a workaround you could manually convert the url to a direct link to the image as shown in this interceptor:
                https://magento.stackexchange.com/a/135233/44090






                share|improve this answer















                Did you manage to solve this?
                It seems your problem is that there is a backend url to the image used in the frontend.



                As a workaround you could manually convert the url to a direct link to the image as shown in this interceptor:
                https://magento.stackexchange.com/a/135233/44090







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Apr 13 '17 at 12:55









                Community

                1




                1










                answered Dec 28 '16 at 10:56









                nbjohannbjohan

                404146




                404146



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f136705%2fcustom-widget-image-is-not-showing-on-frontend-magento-2%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?