Question

We have SiteEdit 2009 SP2 in SDL Tridion 2009 SP1 and it is working fine for normal published pages. It is also working ok if we have single Dynamic Component Presentation (DCP) in a page. But when we have multiple DCPs on the page, it is taking the first one only and ignoring all others.

Here is my code

<xsl:variable name="SE_CP_MarkUP">
<![CDATA[ <!-- Start SiteEdit Component Presentation: {"ID" : "cp_%ID%", "ComponentID" : "%ID%", "ComponentTemplateID" : "tcm:XX-XXXXX-32", "Version" : 0, "IsQueryBased" : true  } -->]]>

I am using this variable in loop

<xsl:value-of select="XXXX:RegexStringReplace($SE_CP_MarkUP,'%ID%',@ID)" disable-output-escaping="yes"/>

Please suggest what could be the issue?

More Detail:

Generated HTML

    <div>
  <!-- Start SiteEdit Component Presentation: {"ID" : "cp_tcm:13-287142", "ComponentID" : "tcm:13-287142", "ComponentTemplateID" : "tcm:13-286965-32", "Version" : 3, "IsQueryBased" : true  } -->
  HTMLConent
</div>
<div>
  <!-- Start SiteEdit Component Presentation: {"ID" : "cp_tcm:13-287162", "ComponentID" : "tcm:13-287162", "ComponentTemplateID" : "tcm:13-286965-32", "Version" : 2, "IsQueryBased" : true  } -->
  HTMLConent
</div>
<div>
  <!-- Start SiteEdit Component Presentation: {"ID" : "cp_tcm:13-287204", "ComponentID" : "tcm:13-287204", "ComponentTemplateID" : "tcm:13-286965-32", "Version" : 1, "IsQueryBased" : true  } -->
  HTMLConent
</div>
<div>
  <!-- Start SiteEdit Component Presentation: {"ID" : "cp_tcm:13-287234", "ComponentID" : "tcm:13-287234", "ComponentTemplateID" : "tcm:13-286965-32", "Version" : 4, "IsQueryBased" : true  } -->
  HTMLConent
</div>
<div>
  <!-- Start SiteEdit Component Presentation: {"ID" : "cp_tcm:13-287251", "ComponentID" : "tcm:13-287251", "ComponentTemplateID" : "tcm:13-286965-32", "Version" : 3, "IsQueryBased" : true  } -->
  HTMLConent
</div>

SiteEdit Settings

<!-- SiteEdit Settings: { "PageID" : "tcm:13-287332-64", "PageVersion" : 2, "TargetTypeID" : "", "ComponentPresentationLocation" : 1, "BluePrinting" : { "PageContext" : "tcm:0-8-1", "ComponentContext" : "tcm:0-13-1", "PublishContext" : "tcm:0-13-1"}} -->

I am getting above html on run time. I am able to open only first component using siteedit on hovering on first CP and nothing happens if I hover on any other CPs.

Also there is no JS error on page.

Thanks, Vikas Kumar

Was it helpful?

Solution

The SiteEdit Component Presentation markup should always be wrapped in an HTML element like a DIV for instance, that way SiteEdit can distinguish the beginning and end of your Component Presentation.

So in your loop you should output something like:

<div>
    <xsl:value-of select="XXXX:RegexStringReplace($SE_CP_MarkUP,'%ID%',@ID)" disable-output-escaping="yes"/>
    <!-- output the content here -->
</div>

OTHER TIPS

Thanks for looking at this, I just realized SiteEdit is doing its job. All SiteEdit markup divs have the same absolute position such that where ever I hover, the div shows at the top.

I am working with the design team to get it sorted.

Thanks, Vikas Kumar

Normally I would say this is due to not giving each Component Presentation a unique ID. But it looks like you've got that covered already.

I assume you have omitted the Setting comment from your question simply out of concern for brevity, right?

Is there any chance that you could give us the entire HTML? Remove any sensitive content, of course, but please verify that you still have the issue after you have done so.

Are you sure the user has rights to all Component's? And do they all exist

It's probably easiest to check in the developer tools of your browser. Find the request for GetComponentAndSchemas.

In the body of that request (so the part that is sent to the server) you will find all Components that SiteEdit is asking for. So if that doesn't cover all of your Components, it somehow didn't find them in the HTML.

Then in the response of that request you should find the Components that were requested plus the Schemas that they are based on. If some Components are not present, they are somehow filtered out on the server. Most likely because the user doesn't have rights, but it could also be that they don't exist in publication 13.

I ran into the same issue particularly if you have any html5 tags around siteedit span/div tags. Have you checked this article (from Bart), it might help. It helped in my case.

http://www.sdltridionworld.com/articles/sdltridion2011/siteedit_zindex.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top