17

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

vikas kumar
  • 2,444
  • 15
  • 25

5 Answers5

7

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

Alvin Reyes
  • 2,889
  • 16
  • 38
vikas kumar
  • 2,444
  • 15
  • 25
5

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>
Bart Koopman
  • 4,835
  • 17
  • 30
  • 3
    Wrap it in a
    or
    please. Wrapping it in a span will just break other things on WebKit browser - and it's showing your age.
    – Frank van Puffelen Jul 12 '12 at 15:24
  • sorry for showing my age, true any HTML element will do and DIV or ARTICLE are probably a better choice indeed (I remember now we had massive issues when using SPAN trying to get the HTML validated ;o). updated accordingly... – Bart Koopman Jul 12 '12 at 15:28
  • Sorry i dint mention but I do already have div around as you all suggested. Regarding version I am not getting any message as of now but I can provide the correct version as well. – vikas kumar Jul 13 '12 at 05:26
  • Then I think you need to provide a lot more detail as in what you have setup and what is not working for you exactly. Like are you getting an error, if so what, or what do you exactly mean with it is not working for you. Has the full HTML on the page been validated (invalid HTML is a known issue for SiteEdit not to work), are there any JavaScript errors on the page that might be in the way etc. etc. Please edit the question and add all the additional information in it or it will be impossible for anybody to provide you with a suitable answer. – Bart Koopman Jul 13 '12 at 07:44
  • @BartKoopman I have updated question again with more detail. I am not getting any error on JS error, siteedit just not taking all CPs. – vikas kumar Jul 13 '12 at 08:24
2

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.

Peter Kjaer
  • 4,316
  • 13
  • 23
  • Also, I believe it should be "ComponentVersion" instead of "Version", although I don't think that's the cause of this particular issue. – Peter Kjaer Jul 13 '12 at 11:31
  • 1
    For what it's worth: I copied your markup to my own site, changed the URIs to match my system, and added a Settings comment. Works like a charm. So we definitely need more info about what problem you are experiencing... – Peter Kjaer Jul 13 '12 at 11:43
  • I have added page setting as well in my question. – vikas kumar Jul 13 '12 at 11:54
1

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.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
1

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

Ram G
  • 4,829
  • 1
  • 16
  • 26
  • Those problems typically start from not having properly nested HTML. If you tell the SiteEdit TBBs to put a around Component Presentations (as they do by default), your HTML will become invalid as as you put a simple
    in there. And that means WebKit-based browsers (Chrome, Safari) will start re-ordering the DOM and you end up with a tiny box around your Component Presentation (that doesn't contain any fields).
    – Frank van Puffelen Jul 13 '12 at 14:48
  • we fixed the issue of overlapping SiteEdit div as well by switching off isotopes query JS, which was conflicting with SiteEdit – vikas kumar Aug 01 '12 at 14:49