A way to remove the <p> tags auto inserted in Content block?

Permalink
Is there a way to remove the <p></p> tags that are automatically wrapped around every line of content in the Content block?

I've messed around with the PHP, couldn't figure it out. Also tried using Textile... nope.

Any suggestions? Thanks.

stephmars
View Replies: View Best Answer
LucasAnderson replied on at Permalink Reply
LucasAnderson
Sounds like you need to change the fckeditor config file.

"If the EnterMode configuration is set to "p" or "div", you may expect that the content of paragraphs will always be enclosed inside a <p> or a <div>. So, the editor behaves accordingly.

If you instead don't want <p>s, just set the EnterMode='br' and no "paragraphization" will happen."

These posts might help you:

http://cksource.com/forums/viewtopic.php?f=6&t=6869...

http://www.tequilafish.com/2008/09/12/fckeditor-remove-p-tags-from-...
stephmars replied on at Permalink Reply
stephmars
Thanks, this sounds like it'll work. One last question though, where is the fckeditor file? I did a search... it's a js file, right? Arrgh. Thanks again.
LucasAnderson replied on at Permalink Reply
LucasAnderson
My bad, it's actually Tiny MCE that concrete5 uses for it's editor, I was looking at a future 'hack'.

I'll take a look and see if Tiny MCE has the same option.
stephmars replied on at Permalink Reply
stephmars
Ah!

I'll search too and update here if I find the answer.

Thanks thanks...
LucasAnderson replied on at Permalink Best Answer Reply
LucasAnderson
Okay, sounds like a config change for Tiny MCE as well.

Find this file (tiny_mce.js) in /concrete5/js/tiny_mce

and change these values to something like this: (1 = true, 0 = false)

force_br_newlines : 1,
force_p_newlines : 0

More information on configuring Tiny MCE can be found here:

http://tinymce.moxiecode.com/punbb/viewtopic.php?id=3878...

http://wiki.moxiecode.com/index.php/TinyMCE:FAQ...
hhockx replied on at Permalink Reply
hhockx
Sorry to bring this old discussion back to the surface but three years later I'm struggling with an alignment problem that looks a bit like the one discussed above.
I'm using Concrete 5.6.0.2 and experience alignment problems both in content blocks and image blocks which I've not seen in other websites (using another theme) that I made and maintain.
- not able to put a small image in a line of text in content block
- not able to put two images next to each other in content block
- images in image block will allways align left , even other alignment is chosen from design.
The new website is still under development so I used an empty page to show all these troubles athttp://loopbaanwerkplaats.hanshockx.nl/index.php/werkblog/...

Any suggestions are welcome!

PS: I tried to edit tiny_mce.js but only found and changed force_p_newlines to 0 which didn't make any difference.
Adreco replied on at Permalink Reply 1 Attachment
Adreco
Please see file image attached. Have you tried aligning content with the text alignment instead? This achieves what you seem to be trying for.
hhockx replied on at Permalink Reply
hhockx
Thank you for your reply! Using text alignment I can get the two images to display next to each other when left aligned. When I select the images and press align center in the editor the images are centered above each other. See the same page again, both options are now added.

What suprises me is that on your screen print the small blue + image is aligned in the text as it should be. Different from what I get to see?
mhawke replied on at Permalink Reply
mhawke
I think there is a mis-understanding about what the 'design' function does for blocks. This controls the alignment of the entire block within it's parent container on the page. In the case of an image block, it does not control the alignment of the image within it's own block. If you look at the source for you test page, you will see a buch of styling like this:
<style type="text/css">
#blockStyle475main48 {
.
.
.
</style>


This is the special block styling you added in the 'Design' area of the block but you can see that it's applying the alignment to the divs SURROUNDING the block, not within the block itself. I don't know a way to just align an image. The core image block doesn't ask for that parameter. I have already built a 'deluxe' image block that adds links to external pages and other stuff. Perhaps I'll add alignment to it as well and make it 'super-deluxe'.

I have no idea how to fix TinyMCE's issues with aligning images. I almost always have to dig into the html that the TinyMCE generates to fix things. Version 5.7 is getting rid of TinyMCE. Can't wait!
mhawke replied on at Permalink Reply
mhawke
Well that was an exercise in futility. I succeeded in adding the alignment parameters to a custom image block but it doesn't really help. The image controller is already built to get passed 'align' and 'style' parameters but that just succeeds in shoving the image around inside it's own div which means it's just stacked up under the other blocks in a big empty void. I'm waiting for the new editor.
hhockx replied on at Permalink Reply
hhockx
You are absolutly right about how the design function works. On my test page I used this option on the image block in the first three examples and there was no visible change between three different alignments (default / center / right).

My original question had to do with adding an image to a content block were it would always align to the left on a new line etc. At first I thought the 'image in text' problem had something to do with the TinyMCE editor but at last I found that was not the case.
After all it turned out to be a CSS-thingy. I had checked CSS earlier to see if images were given a 'float:left' from there but there was not the case. In the end I found out that adding float:none solved all alignment problems in content blocks and image blocks.

For the time being the test page is still there and after changing CSS all alignment stuff is shown as it should. POBLEM SOLVED pfffew....

But I fully agree with you a new editor in the next version of C5 will be more then welcome. Thanks for your help once more!
mhawke replied on at Permalink Reply
mhawke
It's possible that you are just over-riding the natural rendering order of the browser by adding 'float:none'. I also can't find anywhere where a specific 'float:left' is added automatically. Could it be that it's because our browsers is set up to read LTR. I wonder if the same 'native' behaviour happens in browsers set up for RTL languages. I've never messed around with that.
hhockx replied on at Permalink Reply
hhockx
Over-ronding the natural flow of out browsers could be a possibility. I presume it could also mean that the float:left is inherited from some other piece of CSS in the main CSS-file. I'm not really sure about that but I will have a look at that.