Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The view has any XML inline comment then XPM rendering of fields breaks #90

Open
avmgan opened this issue Mar 23, 2018 · 1 comment
Open

Comments

@avmgan
Copy link

avmgan commented Mar 23, 2018

The view contains this <!—Solution for Exercise -> comment. When there are any XML comment, the XPM rendering of fields breaks and XPM editing not working. seems to be an issue with DXA.

Story.jsp:

<%@ taglib prefix="dxa" uri="http://www.sdl.com/tridion-dxa" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<jsp:useBean id="entity" type="com.sdl.modules.Training.model.StoryModel" scope="request"/>
<jsp:useBean id="markup" type="com.sdl.webapp.common.markup.Markup" scope="request"/>

<!-- Solution for Exercise -->
<div class="container-fluid ${entity.htmlClasses}" ${markup.entity(entity)}>

    <div id="location-tile" class="row">
        <c:if test="${not empty entity.picture}">
            <div ${markup.property(entity, "picture")}>
                <dxa:media media="${entity.picture}" />
            </div>
        </c:if>

        <div class="col-sm-6">
            <div class="tile">
                <h2>My Story</h2>
                <h1 ${markup.property(entity, "name")}> ${ entity.name }</h1>
                Article: <br />
                <p ${markup.property(entity, "article")}> ${ entity.article }</p>
            </div>
        </div>
    </div>
</div>

Html Source output:

<span>
  <!--  Start Component Presentation: {
  "ComponentTemplateID" : "tcm:22-814-32",
  "ComponentModified" : "2018-03-22T21:35:16",
  "ComponentTemplateModified" : "2018-03-22T21:10:22",
  "ComponentID" : "tcm:22-813",
  "IsRepositoryPublished" : false
}  -->
  <!-- Solution for Exercise --> 
  <div class="container-fluid "> 
   <div id="location-tile" class="row"> 
    <div data-entity-property-xpath="tcm:Content/custom:Story/custom:picture[1]"> 
     <img src="/campaign/media/Buddy_Passport_tcm22-812_w1024_n.jpg" data-aspect="0" width="" /> 
    </div> 
    <div class="col-sm-6"> 
     <div class="tile"> 
      <h2>My Story</h2> 
      <h1 data-entity-property-xpath="tcm:Content/custom:Story/custom:name[1]"> Velmurugan Arjunan</h1> Article: 
      <br /> 
      <p data-entity-property-xpath="tcm:Content/custom:Story/custom:article[1]"> Woohooo this is a great article!</p> 
     </div> 
   </div> 
  </div></span> 

Without Inline XML Comment Working Html source:

 <div class="container-fluid "> 
  <!--  Start Component Presentation: {
  "ComponentTemplateID" : "tcm:22-814-32",
  "ComponentModified" : "2018-03-22T21:35:16",
  "ComponentTemplateModified" : "2018-03-22T21:10:22",
  "ComponentID" : "tcm:22-813",
  "IsRepositoryPublished" : false
}  --> 
  <div id="location-tile" class="row"> 
   <div> 
    <!-- Start Component Field: {"XPath":"tcm:Content/custom:Story/custom:picture[1]"} --> 
    <img src="/campaign/media/Buddy_Passport_tcm22-812_w1024_n.jpg" data-aspect="0" width="" /> 
   </div> 
   <div class="col-sm-6"> 
    <div class="tile"> 
     <h2>My Story</h2> 
     <h1> 
      <!-- Start Component Field: {"XPath":"tcm:Content/custom:Story/custom:name[1]"} --> Velmurugan Arjunan</h1> Article: 
     <br /> 
     <p> 
      <!-- Start Component Field: {"XPath":"tcm:Content/custom:Story/custom:article[1]"} --> Woohooo this is a great article! for Hello World Training1111</p> 
    </div> 
   </div> 
  </div> 
 </div>

Please let me know if there any further information required.

image

@jhorsman
Copy link
Contributor

This looks like a DXA bug, found on DXA 1.7, likely to appear in DXA 1.8 as well. Unknown if this still exists in DXA 2.0.

willprice76 pushed a commit to willprice76/dxa-web-application-java that referenced this issue Apr 10, 2018
…I-3103 to develop

* commit '90c2d8e0c42255b2e16b22dbb5f21d3e0abc8f8c':
  TSI-3105 Added health check filter (TSI-3103)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants