Hot answers tagged

18 votes
Accepted

Change {{media url="wysiwyg/image.jpg"}} in frontend in custom module

You can filter its using filter() function, $content = 'This is test demo imgage, {{media url="wysiwyg/some_image.jpg"}}'; $om = \Magento\Framework\App\ObjectManager::getInstance(); $filterManager = $...
user avatar
17 votes
Accepted

Add WYSIWYG Editor to Block Form in Magento 2

Discovered I was missing the Config setting: /** * @var \Magento\Cms\Model\Wysiwyg\Config */ protected $_wysiwygConfig; /** * @param \Magento\Backend\Block\Template\Context $context * @param \...
user avatar
  • 823
15 votes
Accepted

Magento 2.3 - TinyMCE4 Toolbar and Plugin Configuration

UPDATE: Per Magefan's below comments, you can install this editor fix via composer. Instructions in their Github Repo. Original answer: Create an afterGetConfig plugin to configure Magento 2.3's ...
user avatar
  • 467
12 votes
Accepted

How can I enable WYSIWYG for product attribute field?

In "Product Attribute" page, when you choose "text area", go down to "Frontend Properties" and Enable "Enable WYSIWYG"
user avatar
12 votes
Accepted

Magento 2: Get WYSIWYG editor's data in frontend?

Let's say the block that displays your content is called Vendor\Module\Block\Entity. Add a dependency Zend_Filter_Interface to your block like this: protected $templateProcessor; public function ...
user avatar
  • 195k
11 votes

Magento 2 how to add product attribute of type textarea with editor programmatically

I have use this script to add custom attribute in products. It's working fine for me. /** @var EavSetup $eavSetup */ $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); /** ...
user avatar
11 votes
Accepted

How to make field as WYSIWYG editor in system.xml in configuration?

Add this in your system.xml file <field id="grid_view" translate="label comment" type="editor" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Grid View</...
user avatar
10 votes
Accepted

Cannot edit widgets in WYSIWYG editor anymore

Apparently it is not related to the patch, but to the latest Chrome update (Chrome 58) which got rolled out around the same time. TinyMCE uses deprecated features that were removed in that version. ...
user avatar
9 votes
Accepted

Cannot display image inserted by WYSIWYG editor

I finally solved the problem. The cause of the problem is unprocessed shortcodes in the html content, which is the {{ media url="..." }} statement. Before echo this statement, the html content should ...
user avatar
9 votes
Accepted

Convert WYSIWYG content into html in magento2

Let's say your popup has a block behind it to handle the logic, and a template to render the result (as it should have). Let's say your block class is \Vendor\Module\Block\Popup Add this to your ...
user avatar
  • 195k
8 votes

Magento 1.9.1.0 - Upload PDF File Type in Wysiwyg Editor and show PDF Icon

In order to allow to upload and link pdf file, I modified your config.xml <?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Pdf_WysiwygFiles> <version&...
user avatar
  • 460
8 votes

Magento 2 WYSIWYG Media image directive using admin url

This is a known bug which is still present in CE 2.1.5. The known fix is to add 'add_directives' => true to getConfig function ofvendor/magento/module-cms/Model/Wysiwyg/Config.php. The best way ...
user avatar
7 votes
Accepted

Why some html tags in not saving in cms pages?

Interestingly enough the save is not the problem. If you copy your html into the cms page and then hit save you will see in the table cms_page that you have your full html in the database. The ...
user avatar
7 votes
Accepted

Magento 2.3.0 WYSIWYG editor's image not loading on frontend

You need to filter that content using cms page filter. Try following way: public function __construct( \Magento\Cms\Model\Template\FilterProvider $filterProvider ) { $this->_filterProvider = ...
user avatar
  • 34.3k
6 votes

The directory is not writable by server. Magento 1.9 on XAMPP

I needed to create /media/wysiwyg and set write permissions. It was not created because magento could not write into /media.
user avatar
  • 3,194
6 votes
Accepted

URL returned by WYSIWYG is wrong

ohh i got answer Myself Login to Admin. Go to System > Configuration > Content Management (Under General) > WYSIWYG Options ‘Use Static URLs for Media Content in WYSIWYG for Catalog’ – ...
user avatar
  • 2,038
6 votes

Change {{media url="wysiwyg/image.jpg"}} in frontend in custom module

You need declare this Class in constructor of Block: Magento\Cms\Model\Template\FilterProvider $filterProvider $content = '{{media url="wysiwyg/some_image.jpg"}}'; $contentGenerating = $this->...
user avatar
  • 3,638
6 votes

Magento 2.1: create a WYSIWYG field in a custom widget

You follow the this url for creating custom widgets. Now as per your requirement for WYSIWYG editor. Open widget.xml file and add new parameter, the code is below. etc/widget.xml <?xml version=&...
user avatar
6 votes
Accepted

Using wysiwyg editor on frontend templates in magento 2

In frontend suppose we want wysiwyg-editor on a textarea and textarea having id : description <textarea id="description" name="textarea_name"></textarea> and use below script to load ...
user avatar
  • 1,503
6 votes

Modify WYSIWYG or TinyMCE configurations in magento 2

I encountered the same problem, solved it by follow way. Navigate to Dashboard > store > settings > Configuration > general > content management > WYSIWYG Options > Enable ...
user avatar
  • 3,195
6 votes
Accepted

Magento 2 - How to add wysiwyg editor in frontend PHTML file?

Suppose you have a textarea: <textarea name="comment" id="comment" class="input-text"></textarea> then to add wysiwyg editor to the textarea, you just need to write following code in ...
user avatar
5 votes

How to replace default Magento editor by Editor based on tinyMCE 4?

You should try the Markdown editor module from SchumacherFM, it works great and replaces the default WYSIWYG editor of Magento. See: https://github.com/SchumacherFM/Magento-Markdown
user avatar
  • 1,037
5 votes

Wrong URL returned by WYSIWYG editor for images

the error is due to Mage::getBaseUrl('media') does not pass the store parameter ! To solve this bug, change in : app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php Find function : ...
user avatar
  • 151
5 votes
Accepted

Use helper function to cms block

I have created one custom module for this and we have specified the our filter to magento by adding the following code in config.xml page <global> <cms> <page> ...
user avatar
5 votes
Accepted

How to add WYSIWYG functionality on my custom Magento 2 module?

Add following code in your file. app/code/Namespace/Modulename/Block/Adminhtml/ModuleFolder/Edit/Tab/Main.php protected $wysiwyg; public function __construct( \Magento\Cms\Model\Wysiwyg\Config $...
user avatar
5 votes

How to create custom category attribute with wysiwyg editor in magento2?

Please follow the below steps to create a custom Category attribute and add it as WYSIWYG Editor in Category form. Step 1: Create custom attribute through Install or Upgrade Script. Below is an ...
user avatar
  • 757
5 votes

Magento 2 - How to add wysiwyg editor in frontend PHTML file?

If your Magento version is 2.3.x then use the following code to add wysiwyg editor in frontend PHTML file. Add Textarea: <textarea name="post_content" class="input-text" id="post_content"></...
user avatar
5 votes
Accepted

How to setContent in wysiwyg editor using JQuery in magento2?

Try below code tinyMCE.get('your_textarea_id').setContent("test");
user avatar
4 votes
Accepted

How to edit admin TinyMCE JavaScript code (without modifying core files)?

You can esily create your own module (depends on Mage_Adminhtml) which is extending that js file: config.xml: <?xml version="1.0"?> <config> <modules> <Your_Module&...
user avatar
  • 2,637
4 votes

WYSIWYG Editor not working in IE 11

Magento uses the TinyMCE WYSIWYG editor. The problems for IE11 seem to be fixed in version 4.x: http://www.tinymce.com/develop/bugtracker_view.php?id=6307 On how to check to upgrade TinyMCE, check ...
user avatar
  • 1,037

Only top scored, non community-wiki answers of a minimum length are eligible