<P>'d Off with Formatting Options!
21 posts by 5 authors in: Forums > CMS Builder
Last Post: May 21, 2009 (RSS)
By Perchpole - June 30, 2008
I know this subject has been raised before but is there any way we can have a proper/permanent solution to the enforced <p> formatting feature in the WYSIWYG editor? The system always seems to want to wrap paragraph tags around your content - whether you like it or not! This happens even if you type the text straight into the HTML window.
In the past, the only advice offered has been to switch the WYSIWYG to a simple text box - but that seems like a bit of a thin solution!
The WYSIWYG box already has a number of formatting options (available for the drop-down menu) - so why can't we just ad a "non" option - for no formatting?!
:o/
Perch
Re: [Perchpole] <P>'d Off with Formatting Options!
By Dave - June 30, 2008
What do you want it to do instead? Output <br/> tags?
There's some explanation why TinyMCE does it this way and options to change it here:
http://wiki.moxiecode.com/index.php/TinyMCE:FAQ#TinyMCE_produce_BR_elements_on_enter.2Freturn_instead_of_P_elements.3F
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/forced_root_block
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/force_br_newlines
Do you think those options would work for you?
interactivetools.com
Re: [Dave] <P>'d Off with Formatting Options!
By Perchpole - June 30, 2008
Interesting stuff. I'll give it a read.
In my particular case, I'm trying to configure a table cell in which I have data drawn from 2 fields in CMSB - namely the title and the content. Because the space is rather tight, however, the opening words of the content will appear on the same line as the title (which will appear emboldened to make it stand out). Obviously you cannot do this if the system inserts a <p> tag between the title data and the content data!
I appreciate there are easier work-arounds for this scenario but (as ever) I'm building this set-up for a client who has next-to-no experience with tools like CMS - so it's really a case of content by numbers...("The title goes in this box and the content text goes in this box - then press this button and magic will happen, etc...").
:0)
Perch
Re: [Perchpole] <P>'d Off with Formatting Options!
By Dave - June 30, 2008
Do you have an example url?
Is using CSS to change how the <p> tag formatting works when inside a <td> an option?
interactivetools.com
Re: [Dave] <P>'d Off with Formatting Options!
By Perchpole - June 30, 2008
Yes, CSS formatting would solve the problem - but it seems like a long way around for an issue I'd rather solve directly! I guess I just begrudge the fact that the WYSIWYG editor "forces" the <p> tags into the code and I have no (direct) way of stopping it!
Hrrrmmphh!
:o/
Perch
Re: [Perchpole] <P>'d Off with Formatting Options!
By Dave - June 30, 2008
Do you just want <p> and </p> removed? Do you want them replaced with anything? Is it just the first <p> you need removed?
interactivetools.com
Re: [Dave] <P>'d Off with Formatting Options!
By Perchpole - July 1, 2008
The code would come in handy - or I could just get my nose into the TinyMCE documentation you hi-lighted.
In any event, thanks as always for your excellent support!
:0)
Perchpole
Re: [Perchpole] <P>'d Off with Formatting Options!
By Dave - July 1, 2008
<!-- remove leading <p>, do this _before_ displaying field value -->
<?php $record['content'] = preg_replace("/^\s*<p>/i", "", $record['content'] ); ?>
Let me know how that goes! :)
interactivetools.com
Re: [Dave] <P>'d Off with Formatting Options!
By monmon - August 6, 2008 - edited: August 6, 2008
I have the same problem & have tried your solution:
[font "Verdana"]<?php $record['fieldname'] = preg_replace("/^\s*<p>/i", "", $record['fieldname'] ); ?>
[font "Verdana"]and I am now getting:
[font "Verdana"]Notice: Undefined variable: record in /home/mesamui/public_html/cms-hotel.html on line 37 in the browser
[font "Verdana"]Can you help please
[font "Verdana"]Thanks in advance
[font "Verdana"]Simon
[font "Verdana"]