oc-wysiwyg-editors icon indicating copy to clipboard operation
oc-wysiwyg-editors copied to clipboard

How I can use Twig syntax inside editor?

Open roulendz opened this issue 7 years ago • 2 comments

I want to make link to a page like this <a href="{{ 'about-us'|page }}">Link to page</a> And when I save it gets saved to <a href="{{%20'about-us'%7Cpage%20}}">Link to page</a> How to make editor not tinker with twig syntax?

Using Froala Editor

roulendz avatar Aug 22 '17 17:08 roulendz

As I see, I need to pass href link as variable, because content blocks do not support twig syntax :( https://octobercms.com/docs/cms/content#content-global-variables

But I can not figure how to do it, nothing returns eave my global variable, to the content block.

roulendz avatar Aug 22 '17 17:08 roulendz

same issue, you can partially solve that by leaving no blank space between tags, this: {{ 'aboutus'|page }}, instead of this: {{ (blank) 'about-us'|page (blank) }}, at least it solve the problem for translate plugin, but this tag "|"(%7) is still an issue, maybe somebody will find a solution, i hope so

gionmaster avatar Aug 23 '17 09:08 gionmaster