Skip to main content
5 votes

When updating a widget instance programmatically, layout updates are removed

The cause of this issue is that the format of the page_groups field needs a different format for saving than is used available after loading. The format needed for saving can be generated from the ...
Aad Mathijssen's user avatar
3 votes
Accepted

Magento 2 : Creating widget using install script

This worked for me please try it. $megaMenuWidget = [ 'instance_type' => 'Magento\Cms\Block\Widget\Block', 'theme_id' => 2, 'title' => 'Test Megamenu Horizontal', 'store_ids' ...
Vindhuja's user avatar
  • 1,395
2 votes

How can I dynamically add fields to a widget's options?

I needed exactly this function and came up with my own widget extension. You can find it on GitHub. But for the impatient here's how to use it: In your widget.xml you can use this extension as a ...
minzwurst's user avatar
2 votes
Accepted

How to change widgets from one theme to another theme?

Best idea is change theme programatically getting all widget using $collection = Mage::getModel('widget/widget_instance')->getCollection(); than change theme whatever you want
Jigs Parmar's user avatar
  • 2,438
1 vote

Magento 2 Add widget using WYSIWYG field in a custom widget

app/code/VendoreName/ModuleName registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, '...
Msquare's user avatar
  • 9,133
1 vote
Accepted

How to create custom widget via Install?

Custom widget can not be created alone with a Install or Upgrade script. You need to create a module for it. Below are the simple steps to create a widget via a module: Create app/code/Stack/...
Mohit Kumar Arora's user avatar
1 vote
Accepted

Magento 2: add classes and icons to homepage widget

You can simply override the template file and changes the html in this file Copy the file from below path vendor/magento/module-catalog/view/frontend/templates/product/widget/new/content/new_grid....
Pradeep Singh's user avatar
1 vote

When updating a widget instance programmatically, layout updates are removed

I think the name of the property is 'page_template' and not 'template' at line: 'template' => $pageGroup['template'] should be 'template' => $pageGroup['page_template']
DexBG's user avatar
  • 111
1 vote

need to add custom template file inside form container magento admin

Add __toHtml() method in form container block. protected function _toHtml() { $tabsContainer = $this->getLayout()->createBlock('core/text', 'example-block')->setText('<div id="...
sandip's user avatar
  • 4,014
1 vote

Get Widget Instance Title

<?php $widgetId =1; $widget = Mage::getModel('widget/widget_instance')->load($widgetId); echo $widget->getTitle(); ?> Try this it's working...
Bhaumik Rana's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible