Skip to content

Instantly share code, notes, and snippets.

@pboethig
Created March 3, 2016 10:34
Show Gist options
  • Save pboethig/29d0908c4e70ae1ee2b1 to your computer and use it in GitHub Desktop.
Save pboethig/29d0908c4e70ae1ee2b1 to your computer and use it in GitHub Desktop.
register a widget in Widgetmanagement via sql installscript
<?php
$widgetParameters = array(
'width_attrib' => '250',
'height_attrib' => '200',
'group_key' => '1'
);
$instance = Mage::getModel('widget/widget_instance')->setData(array(
'type' => 'workflow/task_widget_news',
'package_theme' => 'base/default',
'title' => 'newswidget on the dashboard',
'store_ids' => '0',
'widget_parameters' => serialize($widgetParameters),
'page_groups' => array(array(
'page_group' => 'pages',
'anchor_categories' => array(
'page_id' => 5,
'group' => 'all_pages',
'layout_handle' => 'default,catalog_category_layered',
'for' => 'all',
'is_anchor_only'=>1
),
'notanchor_categories' => array(
'page_id' => 5,
'group' => 'all_pages',
'layout_handle' => 'default,catalog_category_layered',
'for' => 'all',
'is_anchor_only'=>0
),
'all_pages' => array(
'page_id' =>'5',
'layout_handle' => 'default',
'for' =>'all',
'block' =>'right'
),
'pages' => array(
'page_id' =>'5',
'layout_handle' => 'cms_index_index',
'for' =>'all',
'block' =>'right'
),
))
))->save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment