Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
I'm noticing that Nicedit creates divs, spans and br tags instead of creating <p> tags. This is the first editor I've used that does this and it's throwing off the styles as it should be using <p> tags. Is there any way to make it create paragraph tags and then create a new paragraph when hitting enter instead of <br>?

I am setting up a site on a local dev environment using a custom port if that makes a difference as I know some other issues are due to that
Hi,

I am afraid but I don't think Nicedit allows much customization over the kind of code it generates.
Ok thanks KK! what about redactor am I able to integrate it? I noticed on this post that someone bought a license for it viewtopic.php?f=5&t=8144

is there a ready to go set of files I can add to the includes directory to get redactor working?
Redactor requires JQuery and hence is still awaiting the next version of Couch admin-panel that'll use JQuery instead of MooTools.
This is an ugly hack, but what I did with this problem was to use javascript (actually jQuery) to swap out the tags and correct the markup.

Back end:
Code: Select all
<cms:editable name='news_item' type='nicedit' />

Front end:
Code: Select all
<p><cms:show news_item /></p>

Script:
Code: Select all
$('#news p > br').replaceWith( "</p><p>" );

This replaces Nicedit's br tags with a closing and opening p tag. Together with the p tags in the front end code, the end result is ordinary paragraph markup. It's not perfect. The page loads first then changes, causing a little jump. Like I said, it's an ugly hack. The tricky part is targeting only the code you want to correct.

Nicedit is meant to be used with repeatable regions where Couch can't use CKEditor. If you're not using a repeatable region, then the CKEditor (type='richtext') gives better markup.
tim wrote: This is an ugly hack, but what I did with this problem was to use javascript (actually jQuery) to swap out the tags and correct the markup.

Back end:
Code: Select all
<cms:editable name='news_item' type='nicedit' />

Front end:
Code: Select all
<p><cms:show news_item /></p>

Script:
Code: Select all
$('#news p > br').replaceWith( "</p><p>" );

This replaces Nicedit's br tags with a closing and opening p tag. Together with the p tags in the front end code, the end result is ordinary paragraph markup. It's not perfect. The page loads first then changes, causing a little jump. Like I said, it's an ugly hack. The tricky part is targeting only the code you want to correct.

Nicedit is meant to be used with repeatable regions where Couch can't use CKEditor. If you're not using a repeatable region, then the CKEditor (type='richtext') gives better markup.


Hmm yeah I might have to do something like that. thanks!
6 posts Page 1 of 1