Page 1 of 1
Error: TinyMCE add p tag to smarty tag {}
Posted: Tue Aug 27, 2019 11:39 am
by Cyc
When user add smarty tag to TinyMCE editor put smarty code in p tag, it's not good practise.
Re: Error: TinyMCE add p tag to smarty tag {}
Posted: Tue Aug 27, 2019 12:57 pm
by calguy1000
This has been discussed before and is common knowledge.
TinyMCE is a text editor, it does not know if you are embedding a link with a {cms_selflink} or a time/datestamp or a block tag.
i.e:
{News} is a block
{$smarty.now|date_format:'%x %X'} is an inline tag. it is perfectly fine for that to be within <p> tags.
So. For users that are embedding smarty tags, they probably should know the difference between an inline and block tag, and should NOT use the wysiwyg editor for those pages.
For users that are not embedding smarty tags, they can have the WYSIWYG editor.
Re: Error: TinyMCE add p tag to smarty tag {}
Posted: Tue Aug 27, 2019 2:59 pm
by Rolf
In TinyMCE you can disable it by unclicking: "Force paragraph on line break"
https://www.tiny.cloud/docs/configure/c ... root_block
But also has its disadvantages...
Re: Error: TinyMCE add p tag to smarty tag {}
Posted: Fri Aug 30, 2019 5:14 pm
by Cyc
calguy1000 wrote:This has been discussed before and is common knowledge.
Not with me.
calguy1000 wrote:
TinyMCE is a text editor, it does not know if you are embedding a link with a {cms_selflink} or a time/datestamp or a block tag.
i.e:
{News} is a block
{$smarty.now|date_format:'%x %X'} is an inline tag. it is perfectly fine for that to be within <p> tags.
What if I want to put form tag in content block? We have a situation with two p tag and form in p... If I want to resolve this problem, I have to make three content block... UX over 100%...
calguy1000 wrote:
So. For users that are embedding smarty tags, they probably should know the difference between an inline and block tag, and should NOT use the wysiwyg editor for those pages.
...probably should know...
calguy1000 wrote:
For users that are not embedding smarty tags, they can have the WYSIWYG editor.
It's not default solutions.
Re: Error: TinyMCE add p tag to smarty tag {}
Posted: Fri Aug 30, 2019 6:18 pm
by calguy1000
If you are putting tags like {FormBuilder}, {CGBetterForms} or {YourCustomModule} into a content page then that content page is part of the application, not part of the content.
You should either disable the WYSIWYG editor for that page, or block... and preferably not let your content editors edit that page.