I have a module that is installed in other sites. In one site it doesn't show up when inserted into CMS Pages.
{{widget type="Company\Modulename\Block\Widget\Test" template="widget/newsletter/test.phtml"}}
app/code/Company/Modulename/Block/Widget/Test.php:
namespace Company\Modulename\Block\Widget;
class Test extends \Magento\Framework\View\Element\Template implements \Magento\Widget\Block\BlockInterface
{
protected function _construct()
{
parent::_construct();
}
}
app/code/Company/Modulename/view/frontend/templates/widget/newsletter/test.phtml:
<?php
echo 1;
app/code/Company/Modulename/etc/widget.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="test" class="Company\Modulename\Block\Widget\Buttons">
<label translate="true">some text</label>
<description>some text</description>
<parameters>
...
It will show just empty string, no matter what I try. I enabled developer mode but no info about that is inside system.log. Any idea what could be wrong or at least how I can debug this problem?
etc/widget.xml
in your module with declaration of your widget? – Miroslav Petroff Nov 23 '16 at 17:22