ASPX templates
Version 3.x > ASPX templates > Inline controls problem with FCKEditor View modes: 
User avatar
Member
Member
andrew - 1/15/2009 7:00:29 AM
   
Inline controls problem with FCKEditor
Hi,

A problem that has been bugging me with Kentico Inline controls is that when you insert an inline control into an editable region e.g.

%%control:AudioPlayer?%%

This, like any other text in the editable region, automatically gets wrapped with the default new-line break (e.g. '<br />' or <p>).

This is problematic for me as many of my inline controls render their content with block-level elements, e.g

<div id="whatever">
<p>More</p>
</div>

When this is rendered on the final page the markup will be:

<p>
<div id="whatever">
<p>More</p>
</div>
</p>

This is invalid XHTML. Is there a way (without hacking the FCKEditor js code) to get FCK to ignore inline controls when applying it's "corrective" actions?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 1/15/2009 8:36:42 AM
   
RE:Inline controls problem with FCKEditor
Hello,

could you please tell me which version of Kentico CMS are you using?

I tested this issue:

I create a custom inline control which contains only text: “My text”.
I insert it by the FCKEditor on the page.
I check the source code of rendered page – no tags are inserted – neither '<br />' nor <p>.

Maybe it could be some individual settings of FCKEditor – please see here for information about its configuration: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options

Best regards,
Helena Grulichova

User avatar
Member
Member
andrew-xcomms - 1/19/2009 3:40:05 AM
   
RE:Inline controls problem with FCKEditor
Hi Helena,

Thanks for your reply. I think the problem occurs when an inline control is to be inserted on it's own line in the text area for example


------------------------ Inside Textarea ---------------------------

Some content in a paragraph in a paragraph in a paragraph in a paragraph in a paragraph in a paragraph in a paragraph in a paragraph.
%%control:AudioPlayer?%%
Some more content in a paragraph in a paragraph in a paragraph in a paragraph in a paragraph in a paragraph in a paragraph.

------------------------ Inside Textarea ---------------------------


Ideally in the rendered page, the above should produce markup like:

<p>Some content in...</p>
<div id="audioPlayer">
...blah...
</div>
<p>Some more content...</p>

However it will produce markup like:

<p>Some content in...</p>
<p><div id="audioPlayer">
...blah...
</div></p>
<p>Some more content...</p>

This is not necessarily an issue in FCKEditor when not used with Kentico, as all content on a single line is wrapped in HTML when you hit the ENTER key.

I realise this may be an obscure problem, however it makes the Inline Controls feature of limited use for me as many of our sites require strict XHTML validation.

Thanks for your help,
Andrew

User avatar
Member
Member
andrew-xcomms - 1/19/2009 3:40:54 AM
   
RE:Inline controls problem with FCKEditor
Sorry, the version of Kentico I am using is 3.1a

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 1/20/2009 9:26:59 AM
   
RE:Inline controls problem with FCKEditor
Hello,

the first possibility is to check the Source code of Editable region and delete/write the appropriate tags.

The second possibility is to set the FCKEditor so that it adds a <div> tags when you press Enter. You could change the file:

<your web site folder>/CMSAdminControls/FCKEditor/fckconfig.js

– lines about 188 – like this:
FCKConfig.EnterMode = 'div'; // p | div | br
FCKConfig.ShiftEnterMode = 'div'; // p | div | br


Best regards,
Helena Grulichova