Stopping p tags around images in content block? Anyone worked this out?

Permalink 5 users found helpful
Hi all, I have searched the forums here and found various posts mentioning the issue, but not seen the solution (apologies if I have just missed it)

basically has anyone worked out how to get (presumably) tinymce to stop wrapping paragraph tags around images if the image is inserted in a content block? It's an annoying thing - I know css wise just target: p img{} BUT this doesn't solve the issue for all layouts where you need the actual p tag to have some specific positioning (ie when the image is floated)

Currently my work around is for people to add an image block (as this doesn't wrap a p tag) and then a seperate content block for the text but it would be a lot easier for editors to just use one content block

If anyone has fixed this I will give them many bunny hugs!!

 
tek01 replied on at Permalink Reply
MAybe you can find the solution here http://modxcms.com/forums/index.php?topic=28908.0...
monkeyboystu replied on at Permalink Reply
yes perfect thank you!!!

For others with this issue do the following:
open
/concrete/tiny_mce/tiny_mce.js

find: forced_root_block: "p",
change to forced_root_block: false,

job done!
tek01 replied on at Permalink Reply
Great! Please give karma to me my friend ;)
monkeyboystu replied on at Permalink Reply
done :)
modularte replied on at Permalink Reply
modularte
Hello,

I have the same problem. I've tried everything. I've already tried that but it didn't help.

open
/ concrete / js / sf

find: forced_root_block: "p",
change to forced_root_block: false,

I've cleared all caches. It's a cramp.
I hope someone has a solution.
RoyS replied on at Permalink Reply
RoyS
It looks like you can do this a lot more safely and cleanly by using the dashboard now. According to this post: http://www.concrete5.org/community/forums/customizing_c5/tinymce-co...

Go to: "Dashboard > System and Settings > Basics > Rich Text Editor"
ctvc replied on at Permalink Reply
This is without a doubt the single most useful post I have read on the Concrete5 community since I started working with Concrete5 about six months ago!

At last! I'm so glad it's possible to get rid of hose pesky P tags!
siteadvice replied on at Permalink Best Answer Reply
siteadvice
If you upgrade to the latest version of Concrete5, you'll need to make this edit again here:

/wwwroot/updates/concrete5.5.1/concrete/js/tiny_mce/tiny_mce.js
zoinks replied on at Permalink Reply
Any idea why this doesn't work? I cleaned my cache and I triple checked it. Ain't doing jack.
siteadvice replied on at Permalink Reply
siteadvice
Remember to check the upgrade path if your version of C5 has been upgraded (see my post just above yours). If you have upgraded the site at some point then there will be two complete versions of tiny_mce on the server. Not a very efficient use of disk space, but there you are. If it's not that, I don't know any reason why it wouldn't work.
zoinks replied on at Permalink Reply
thanks. It's a straight install of 5.5.2 so there's no upgrade.
EDIT: I guess somehow it was stuck in Chrome (surprising). Safari is the best damn browser in the world for completely flushing the cache and resetting. Just tried it there and it works. Thanks!
keeasti replied on at Permalink Reply
keeasti
I just came across this post when trying to find a way to prevent <p> tags from being added automatically in TinyMCE.

Editing tiny_mce.js as one poster suggested worked for me but I think it is probably better to copy /concrete/blocks/content/editor_config.php to /blocks/content/editor_config.php and then edit this file near the top by adding forced_root_block: false, as follows:

<script language="javascript">
tinyMCE.init({
   forced_root_block: false,//add this to stop forced <p></p> tags
   mode : "textareas",
   width: "100%", 
...code continues


This way, upgrading C5 should not affect the mod.
mrjcgoodwin replied on at Permalink Reply
mrjcgoodwin
I know this is a really old post, but it ranks highly on Google for this particular issue.

In the most recent version (of 5.6) you need to make this edit as a hybrid of the above instructions.

- Navigate to system and settings via the dashboard
- Change the rich text editor toolbar set to 'custom'
- Then add the snippet below into the top section of the custom settings (make sure to observe the commas at the end of the lines)

forced_root_block: false
keeasti replied on at Permalink Reply
keeasti
I actually used it in C 5.6.1.2 but I think your method will work as well.
swetanka replied on at Permalink Reply
can any one please suggest me how to remove p tag by default in concrete v5.7
really not getting any help in it