Error: TinyMCE add p tag to smarty tag {}

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
Cyc
Forum Members
Forum Members
Posts: 91
Joined: Wed Nov 18, 2015 11:54 pm
Location: Poland

Error: TinyMCE add p tag to smarty tag {}

Post by Cyc »

When user add smarty tag to TinyMCE editor put smarty code in p tag, it's not good practise.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Error: TinyMCE add p tag to smarty tag {}

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Error: TinyMCE add p tag to smarty tag {}

Post 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...
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
Cyc
Forum Members
Forum Members
Posts: 91
Joined: Wed Nov 18, 2015 11:54 pm
Location: Poland

Re: Error: TinyMCE add p tag to smarty tag {}

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Error: TinyMCE add p tag to smarty tag {}

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Modules/Add-Ons”