Take the 2-minute tour ×
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It's 100% free, no registration required.

I am trying to edit the content of a page using experience manager in Tridion2013 SP1 for a DD4T site. When i click on the rich textbox, Content from the textbox disappears at sudden. I have checked the markup for the page which looks fine. I am using the same DD4T view and same CP on different page for which site edit is working..

<section class="centerCol">
<!-- Start Component Presentation: {"ComponentID" : "tcm:33-1738", "ComponentModified" : "2014-05-21T20:28:56", "ComponentTemplateID" : "tcm:33-1688-32", "ComponentTemplateModified" : "2014-05-07T19:48:12", "IsRepositoryPublished" : false} -->
<article>
<!-- Start Component Field: {"XPath":"tcm:Content/custom:GeneralContent/custom:BodyText[1]"} --><p xmlns="http://www.w3.org/1999/xhtml"><span style="font-size: 16pt;">
Editing Works for this text</span></p><p xmlns="http://www.w3.org/1999/xhtml"><span style="font-size: 16pt;">Editing Works for this text</span></p>
</article>



<!-- Start Component Presentation: {"ComponentID" : "tcm:33-1740", "ComponentModified" : "2014-05-12T18:08:57", "ComponentTemplateID" : "tcm:33-1686-32", "ComponentTemplateModified" : "2014-05-07T19:47:57", "IsRepositoryPublished" : false} -->
<article class="contentWithImage ">
<hgroup>
  <h2><!-- Start Component Field: {"XPath":"tcm:Content/custom:GeneralContentWithImage/custom:Header[1]"} -->Editing does not Works for this text</h2>
</hgroup>

<span>
    <p xmlns="http://www.w3.org/1999/xhtml">Editing does not Works for this text</p>
     <!-- Start Component Field: {"XPath":"tcm:Content/custom:GeneralContentWithImage/custom:BodyText[1]"} -->
</span>
</article>

</section>
share|improve this question
    
Please share the relevant markup. What may look fine to you, may allow others to understand why you're getting the behavior that you do. –  Frank van Puffelen Aug 4 at 11:17
    
And if you open the component in form view, do you see the text? –  Nuno Linhares Aug 4 at 11:48
    
yes, it is visible in form but when I click on the area it just disappears. –  Manish Mehmood Aug 4 at 12:16
    
Are you sure that you're rendering a Component field in your CP that contains a value? –  Nickoli Roussakov Aug 4 at 12:18
2  
If you are "using the same DD4T view and same CP on different page for which site edit is working.." then this must be style or content related? Can you confirm the HTML/Class structure is the same using developer tools - also confirm if the content is still in the DOM etc. –  Dylan .. Mark Saunders Aug 4 at 19:33

2 Answers 2

The second field's siteedit markup should be rendered before the field, not after. Try changing your dd4t view so that the output is like this:

<span>
<!-- Start Component Field: {"XPath":"tcm:Content/custom:GeneralContentWithImage/custom:BodyText[1]"} -->
    <p xmlns="http://www.w3.org/1999/xhtml">Here is some text</p>
</span>
share|improve this answer
    
Hi Nikoli,I have changed the view and Output is now looking as you have mentioned but still facing the same issue. –  Manish Mehmood Aug 4 at 12:36
    
Issue has now been resolved. I was using @Html.SiteEditComponentPresentation(Model) outside of <article> tag in the View.As per experience manager any @Html.SiteEdit code should be inside HTML tag. –  Manish Mehmood Aug 5 at 9:22

Issue has now been resolved. I was using @Html.SiteEditComponentPresentation(Model) outside of <article> tag in the View.As per experience manager any @Html.SiteEdit code should be inside HTML tag.

<article>
@Html.SiteEditComponentPresentation(Model)
@if (Header != String.Empty) {
    <h2>
    @Html.SiteEditField(Model.Component,Model.Component.Fields["Header"])
   @Header</h2>
}
@if (SubHeader != String.Empty) {
    <h3>@Html.SiteEditField(Model.Component,Model.Component.Fields["SubHeader"])@SubHeader</h3>
}
@if (BodyText != String.Empty) {

  <div>  @Html.SiteEditField(Model.Component,Model.Component.Fields["BodyText"])@Html.Raw(BodyText)</div>
}
</article>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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