Answers:
如果您不知道窗口小部件ID,则可以使用它,它不仅限于模板。
$collection = Mage::getModel('widget/widget_instance')->getCollection();
$collection->addStoreFilter(Mage::app()->getStore()->getId(), false)
->addFieldToFilter('title', $filter)->load();
$widget = $collection->getFirstItem();
if($widget && is_numeric($widget->getId())) {
$widgetBlock = Mage::app()->getLayout()
->createBlock(
$widget->getType(),
$widget->getTitle(),
$widget->getWidgetParameters()
);
return $widgetBlock;
}
return false;