Is it Possible to Use Twig Tags in WYSIWYG?
Created 1 year ago by b1gw0rm

Is it possible to use {% %} or {{ }} tags in the WYSIWYG? Currently we have WYSIWYG field stacked on an HTML field in our page template in order to allow us to add custom Twig tags via the page editor since the HTML field allows for it. Previous Pyro you could add template stuff {{ }} inline inside the WYSIWYG. It would be nice to be able to use TWIG to inline stuff inside the WYSIWYG and not have to add a separate HTML field for each page to handle that. However, I understand there are likely design/development reasons for not letting TWIG tags be parsed by the WYSIWYG field type.

edster  —  1 year ago Best Answer

Yep you can, but you have to enter it in HTML mode. If you don't it will parse the tags into character codes. Make sure you are rendering the WYSIWYG with |raw though.