wutzebaer
wutzebaer

Reputation: 14863

magento widget does not appear

i've an module

Shop_All.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Shop_Productlists>
            <active>true</active>
            <codePool>local</codePool>
        </Shop_Productlists>
    </modules>
</config>

widget.xml

<?xml version="1.0"?>
<widgets>
    <productlists_suggestion type="productlists/suggestion">
        <name>Suggestions</name>
        <description type="desc">Shows a product Grid</description>
    </productlists_suggestion>
</widgets> 

Suggestion.php

<?php
class Shop_Productlists_Block_Suggestion extends Mage_Core_Block_Abstract implements Mage_Widget_Block_Interface
{
    protected function _beforeToHtml()
    {
        $this->_prepareData();
        return parent::_beforeToHtml();
    }

    protected function _prepareData()
    {
        $collection = Mage::getModel("catalog/product")->getCollection();
        $collection->setPageSize(3);
        $this->getChild("suggestion_notoolbarlist")->setCollection($collection);
    }

    protected function _toHtml()
    {
        $html = '...';
        return $html;
    }   
}

but the widget doesn't show up in admin panel under CMS->Widget-Instances->New Widget Instance

any ideas why? I've already deleted the cache dir and relogged to the admin panel

Other Blocks etc. of the "productlists" module are working

Upvotes: 0

Views: 2226

Answers (1)

wutzebaer
wutzebaer

Reputation: 14863

Ok found the problem,

in my widget.xml there was a space before

<?xml version="1.0"?>

so it wasn't parsed. i think the parser should have shown an error. but he didn't

Upvotes: 2

Related Questions