When using the rich text editor, can I suppress the writing of <p></p> around {{chunks}}?
The user has the option of using a "highlighted" info area in either the main content area or in the Sidebar TV. But every time {{dktexturebg-top}} & {{dktexturebg-btm} is used to frame the highlighted content, extra <p></p> code embraces the table begin and end calls.
This can, at times, have unexpected white space results.
Is there any way to suppress <p> tags enveloping {{chunk}} declarations?
Thank you!
-Doug
-
☆ A M B ☆
- 24,524 Posts
Supposedly you can add a custom configuration to the TinyMCE plugin stopping the forced_root_block feature, but I’ve never had any success with that. Try specifically using div tags; they won’t cause formatting shifts like <p> tags will.
What I am trying to do is write:
{{chunk}}
But what is rendered is:
<p>{{chunk}}</p>
I think you understood that, and possibly editing a custom configuration for TinyMCE might take care of that, but at the same time the client will be using the CMS and will expect the rich text editor to work, adding paragraphs for each line break/return.
The <p></p> tags enveloping my chunk does break the validation, though. I’m not quite sure how to approach that. And I’m not a developer, so I doubt that I would know how to configure TinyMCE.
If anyone has the solution, I would love to hear it.
Thanks! -Doug
go to the TinyMCE’S plugin configuration tab and add following code to the "Custom Parameters" field:
forced_root_block:0
Cool.
OK, Trying that now.
It turns out that sometimes it actually makes a <p><span>{{chunk}}</span></p>, when only {{chunk}} is typed. I am guessing that this addresses at least the <p> and probably both since you seem familiar with it.
SWEEEEET!
Thank you, sharkbait!
I was worried that I wouldn’t be able to hang validation badges on the site.
Thanks again! -Doug
I always select the "p" and choose "div" from the formatting dropdown
An enveloping set of <div> tags would break the code validation just as the <p> does. Sharkbait’s solution works great.
The problem is that they have options on how to style a highlight area in the sidebar. They don’t have to style it, or they can use a dark background. Therefore, there is a top chunk to start a table, and a bottom chunk to end it. And yes, this is one of those old school hacks of using a table that is impossible to do with a div. They are all hacks until we can actually do what we need to do with the right standards, but so far CSS3 is a long way off.
Anyways, Thanks Again, Sharkbait!
-Doug