SaaS CMS has officially launched! Learn more now.

Dynamic Content causes line breaks

Vote:
 

Hi,

When you add dynamic content in an editor it will add a bunch of divs as a placeholder for your dynamic content in the editor. Since the div tag is not allowed inside a p tag this will cause the insertion of dynamic content to close the p tag before it and start a new one after it which in turns results in line breaks.Example:Lets say you have the following code:

<p>You are visiting [Insert web site name using dynamic content here] right now.</p>

    

When you insert the dynamic content the resulting html will be this:

<p>You are visiting</p>
<div data-hash="+rt+MXKboxafKb0V2uY/v+RkPhtJ6S8/vJm0W0szokk=" data-state="a692c541-3dc2-4461-b2ca-23ce16c960d6|WebSiteName" data-dynamicclass="PagePropertyPlugin" data-classid="b30218a7-77fc-43dd-a844-81935aa9b35e" class="epi_dc mceNonEditable">
<div class="epi_dc_h">
<div class="epi_dc_l">
<div class="epi_dc_title">Page property</div>
</div>
<div class="epi_dc_t"><a href="#" class="epi_dc_editBtn">.</a><a href="#" class="epi_dc_previewBtn">.</a></div>
</div>
<div class="epi_dc_preview">
<ul>
<li style="display: inline-block; padding-right: 10px;">From page: <strong>Site configuration [263]</strong></li>
<li style="display: inline-block;">Property: <strong>Web site name</strong></li>
</ul>
</div>
</div>
<p> right now.</p>

    

As you can see the fact that the dynamic content placeholder is rendered with divs causes tinyMCE to close the p tag just before it and open up another one right after it. (I have tried allowing divs inside of p tags by altering the config of tinyMCE but it does not seem to work.)My question is simply, is there any way you could alter the way the dynamic content placeholder is rendered so that it will render using spans instead for instance?

#80195
Jan 16, 2014 13:56
Vote:
 

Seems that you might want to read this recent thread: http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=79984

#80203
Jan 16, 2014 14:50
Vote:
 

Thanks for the quick reply!

 

Yes, setting backing type to PropertyString for properties used by the built in dynamic content plugin or overriding RenderAsBlockElement when implementing your own plugin solved the problem. Thanks!

#80211
Jan 16, 2014 15:45
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.