TinyMCE <p> <br />

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
spike
Forum Members
Forum Members
Posts: 153
Joined: Thu Sep 25, 2008 5:02 pm

TinyMCE <p> <br />

Post by spike »

Upgraded to the latest TinyMCE module version this morning.
Return now gives a <br /> line-break
and Shift+Return gives me a <p> new paragraph
The norm in typesetting, text editors, word processors, dtp programs etc. for over 30 years has been the opposite.
Is there any way I can change this back to the norm?
gruss - spike
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: TinyMCE <p> <br />

Post by Rolf »

We noticed this too. As far as I know, this behaviour is changed in core TinyMCE. Don't know if we can change anything. Silmarilion is looking in it.

Grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
spike
Forum Members
Forum Members
Posts: 153
Joined: Thu Sep 25, 2008 5:02 pm

Re: TinyMCE <p> <br />

Post by spike »

Hi Rolf,

In the meatime - I downloaded the latest core TinyMCE and installed it on one of my sandbox domains, works perfectly. Unfortunately I'm not a programmer but something appears to have got "back to front".

thanks for your post - my best regards - gruss - spike
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: TinyMCE <p> <br />

Post by paulbaker »

spike wrote:something appears to have got "back to front".
Hi spike, it appears to be a deliberate change by the guys over at TinyMCE. See the link on post 3 of this similar thread:
http://forum.cmsmadesimple.org/viewtopi ... 79&t=61728
faglork

Re: TinyMCE <p> <br />

Post by faglork »

Hi!

I don't get it. They don't say WHY they changed it. EVERY word processor software I know inserts a P when you hit ENTER and a BR when you hit SHIFT-ENTER. Only in TinyMCE it will be the other way 'round. So this is going to confuse our users :-(

But: "So just set forced_root_block to false and it will start spitting out those pesky BR elements."

Doesn't that mean that this is disabled by default?

Cheers,
Alex
spike
Forum Members
Forum Members
Posts: 153
Joined: Thu Sep 25, 2008 5:02 pm

Re: TinyMCE <p> <br />

Post by spike »

I don't get it either, these are standard keyboard commands and have been for the last four decades as far as I can remember. They're not only standard across the various software programs but also work across different platforms. Let's hope they see the folly of their ways. There must be literally billions of people who use these commands unconsciously, it's certainly been very irritating these last couple of days when switching from any other program to Tiny and having to consciously think backwards.
A very foolish move on Tiny's part methinks.
grumble grumble . . .
gruss - spike
faglork

Re: TinyMCE <p> <br />

Post by faglork »

http://forum.cmsmadesimple.org/viewtopi ... 18#p281918

Thread is locked, we are told to discuss here. So, here goes:

In TinyMCE (not microtiny) you can get back the old behavior by setting the option in Advanced Options - don't know what it is called in English, in German it is "Absätze erzwingen" which translates to "Force paragraphs".

But there is still the problem with P surrounding module calls (which is not new problem, I admit).

I am no smarty expert, but couldn't we write a prefilter.freeTag.php which disposes the surrounding P elements from the { tag }?

Cheers,
Alex
spike
Forum Members
Forum Members
Posts: 153
Joined: Thu Sep 25, 2008 5:02 pm

Re: TinyMCE <p> <br />

Post by spike »

This appears to fix it for me -
if you want <p> for return (Carriage Return) and <br /> for shift+return (Soft Return)
put following in advanced extra config window
forced_root_block:true

don't forget the commas if you've got anything else in that window

gruss - spike
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: TinyMCE <p> <br />

Post by calguy1000 »

But there is still the problem with P surrounding module calls (which is not new problem, I admit).
And there is absolutely no way to fix this.

a: tinymce doesn't know anything about smarty.
b: a call to {mymodule arg1=foo arg2=bar} may produce block code, or inline text there is no way that tinymce can know this. infact, even smarty doesn't know what it will produce it just calls some php code that generates some output.

solution: If all you are doing is calling a module from within a content block, then you should be disabling the wysiwyg for that block and/or 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.
faglork

Re: TinyMCE <p> <br />

Post by faglork »

calguy1000 wrote:
But there is still the problem with P surrounding module calls (which is not new problem, I admit).
And there is absolutely no way to fix this.

a: tinymce doesn't know anything about smarty.
ok, but the prefilter.anchorreplace.php works perfectly ...
calguy1000 wrote: b: a call to {mymodule arg1=foo arg2=bar} may produce block code, or inline text there is no way that tinymce can know this. infact, even smarty doesn't know what it will produce it just calls some php code that generates some output.
This seems to be a minor problem. All modules I have used so far produce block output. And if a plugin produces inline output it is usually not called with an etra line.
calguy1000 wrote: solution: If all you are doing is calling a module from within a content block, then you should be disabling the wysiwyg for that block and/or page.
I simply cannot tell my users that they have to learn HTML for the simple task of inserting a youtube video or a GoogleMap.

I wrote a litte filter which I still have to test, so far it seems to work:

prefilter.freetag.php

Code: Select all

<?php
function smarty_cms_prefilter_freetag($tpl_source, &$smarty)
{
return preg_replace('/<p>(\{[A-Za-z0-9\\._-]+\})<\/p>/', "$1", $tpl_source);
}
?>
Do you see any problems with this?

Cheers,
Alex
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: TinyMCE <p> <br />

Post by calguy1000 »

Do you see any problems with this?
Yep, tonnes... but I'll let you flail around for a few days before you find out it's problematic.
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.
faglork

Re: TinyMCE <p> <br />

Post by faglork »

calguy1000 wrote:
Do you see any problems with this?
Yep, tonnes... but I'll let you flail around for a few days before you find out it's problematic.
Thank you very much for sharing your insight.

Regards,
Alex
User avatar
airelibre
Dev Team Member
Dev Team Member
Posts: 98
Joined: Tue Dec 01, 2009 3:42 pm
Location: Alsace // France

Re: TinyMCE <p> <br />

Post by airelibre »

Hi guys,

See the new 3.5.6 version of TinyMCE: http://www.tinymce.com/develop/changelog/?type=tinymce

It seems that they have corrected the problem :
"Fixed so force_p_newlines option works again since some users want mixed mode paragraphs."

I'm just doing some tests, and adding :
force_br_newlines : false,
force_p_newlines : true,

To the config of the TinyMCE module seems to work!
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm
Location: Florida

Re: TinyMCE <p> <br />

Post by carasmo »

For videos I created a UDT:

Code: Select all

/*
Elastic YouTube iFrame for use with responsive css
Parameter: url
Reference: http://webdesignerwall.com/demo/elastic-videos/
*/
echo '<div class="video-wrapper clearfix">';
echo '<div class="video-container">';
echo '<__iframe width="800" height="510"';
echo ' src="'.$params['url'].'"';
echo '></__iframe></div>';
if ($params['caption']) {
echo '<p>';
echo ''.$params['caption'].'';
echo '</p>';
}
echo '</div>';
Then in the TinyMCE in the advanced Custom drop down:

Code: Select all

---|---
Insert Youtube iframe |{*do not put between p tags*}{elastic_youtube_iframe url=" "}
---|---
Then I gave customers a PDF with screen shots on how to do and turn off the editor to drag the code outside the paragraph. This is combined with the elastic videos css, works great on content pages, but for the blog or news, unless their adding multiple videos to these pages, then I put just a input field for the id and it grabs the youtube thumb or vimeo thumb for the summary and the video for the post, I have some info in the tips and tricks section.
faglork

Re: TinyMCE <p> <br />

Post by faglork »

carasmo wrote: Then I gave customers a PDF with screen shots on how to do and turn off the editor to drag the code outside the paragraph.
But they will have to do this *every time* they re-edit the page.

And it is no solution for all other module/plgin/udt calls.

BTW, I am still looking for the "tonnes of problems". Maybe CG could give at least a hint ...

Cheers,
Alex
Post Reply

Return to “Modules/Add-Ons”