I am using a wysiwyg field in my widget, value are well inserted but on frontend html markers and attributes are displayed as text.
{widget type="Vendor\Module\Block\Widget\Sliderimage" textarea="<ul> <li>Base </li> </ul>"}}
I have to first decode html special chars to reencode it in order to display html, this is heartbreaking.
Now i am do this:
$allowedTags = ['a', 'b', 'p', 'li', 'ul']; $textarea_1 = $block->escapeHtml(htmlspecialchars_decode($block->getData('textarea_1')), $allowedTags);
I use that widget block:
use Magento\Framework\View\Element\Template; use Magento\Widget\Block\BlockInterface; class Sliderimage extends Template implements BlockInterface
How can i hook beyond the getData functions to get my html parameter display in the right way ?
Thank you,
Damien.
Hello @KennedyA
you can pass
{{block test=test"}}
in block file yo will get value by
$this->getData('test')
if works then mark as solution
The widget is inserted in a content cms page for exeample, the html fied use the wysiwyg to use html code:
{widget type="Vendor\Module\Block\Widget\Sliderimage" textarea="<ul> <li>Base </li> </ul>"}}
We cannot use your solution.
Hello @KennedyA
what do you mean?
Your solution is not appropriate.