5

I'm having some issues with Rich Text fields in XPM. When I add markup with html tags like <p> or div XPM seems to get confused. When I click on rich text field with those tags in it XPM treats it like an empty field and adds a new box with <add text> or populates it with a copy of content in it and moves the existing content down. This is not a multi-value field. Is this a bug or am I doing something wrong? Here is my markup and some screenshots:

<p>            
  <span>
  <!-- Start Component Field: {"XPath":"tcm:Content/custom:Content/custom:Content[1]"} -->
    <p>Generic Item Content <a href="/showcase/LinkTest.jsp"  title="Copy of Generic Item" >Generic Item</a></p>
    <p>asdasdasdasd</p>
    <p style="margin-left: 40px; text-align: center;">asdasdasdasdasd asdasdasdasd</p>
    <p>asdasdasdasd</p>
    <p>asdasdasd</p>
  </span>            
</p>

XPM Issue 3 XPM Issue 1 XPM Issue 2

  • Can you check if this is consistent across browsers or just with Chrome? It could be due to html rules (p and div are not valid within a span, so you may want to explore using a different tag - this is a parameter in the Enable Inline Editing TBB) – Nuno Linhares Apr 17 '14 at 19:56
  • 1
    I tested it in IE and Chrome and it was happening. Switching to div corrected it. I should have thought of that. Post it as an answer so I can mark you correct. Thanks! – Nate Niemi Apr 17 '14 at 20:15
8

It probably is because of html validation in your browser. <span> cannot contain block elements, like <div> or <p>, and changing the element used by Experience Manager in the "Enable Inline Editing" Template Building Block should solve this (you can use a div for instance).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.