:::: MENU ::::
Posts tagged with: WYSIWYG

Magento 2 Render WYSIWYG content

Today we discuss how in Magento 2 Render WYSIWYG content. This topic will cover how to render wysiwyg editor content.There are two ways to render the WYSIWYG content. First Zend_Filter_Interface and second Using the \Magento\Cms\Model\Template\FilterProvider.

Using Zend Interface

namespace QaisarSatti\HelloWorld\Block;

class HelloWorld extends \Magento\Framework\View\Element\Template
{
protected $contentProcessor;
public function __construct(
    \Zend_Filter_Interface $templateProcessor,
) {
 
    $this->contentProcessor = $contentProcessor;
}
public function processContent($content)
{
    return $this->contentProcessor->filter($content);
}
}

Now Add block reference in di.xml

<type name="QaisarSatti\HelloWorld\Block\HelloWorld">
    <arguments>
        <argument name="contentProcessor" xsi:type="object">Magento\Widget\Model\Template\Filter</argument>
    </arguments>
</type>

Now call method from phtml

<?php echo $block->processContent($content);?>

Using CMS Model

namespace QaisarSatti\HelloWorld\Block;

class HelloWorld extends \Magento\Framework\View\Element\Template
{
protected $contentProcessor;
public function __construct(
    \Magento\Cms\Model\Template\FilterProvider $contentProcessor,
) {
 
    $this->contentProcessor = $contentProcessor;
}
public function processContent($content)
{
    return $this->contentProcessor->getPageFilter()->filter($content);
}
}

Now call method from phtml

<?php echo $block->processContent($content);?>
Author: Qaisar Satti
Category: Magento 2
Last Modified: July 12, 2018


Magento 2 bluefoot cms

On DECEMBER 21, 2016 magento announces of acquiring bluefoot cms. It will Works with Magento Enterprise Edition 2.1 and up version. Magento was using the WYSIWYG editor before now they are giving additional option for use the bluefoot cms. You can say it is replacement of WYSIWYG. The big feature that are provided by bluefoot cms. The current version of Bluefoot CMS (v1.0) is available for merchants.

Drag & Drop Functionality

You can use the drag & drop functionality like Headers, images, products, maps and much more can easily be added as content using drag and drop functionality.

Easy Product-Content Integration

Simple drag and drop of products or groups of products into standard content elements, like blog posts or promotion pages to facilitate merchandising.

Simple Third Party Content Integration (e.g. Videos)

You can add the third party videos like YouTube / Vimeo videos, Google Maps and more are all integrated making it easy to add rich content to pages, categories and posts.

Static Block Integration

Seamless integration of static blocks into your content ensuring that areas of the site such as categories can be turned into any design you like.

Author: Qaisar Satti
Category: Magento 2
Last Modified: July 12, 2018