title: Multiple Dynamic SiteEdit CPs on a Page
body: <p>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.</p>
  
  <p>Here is my code</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;xsl:variable name="SE_CP_MarkUP"&gt;
  &lt;![CDATA[ &lt;!-- Start SiteEdit Component Presentation: {"ID" : "cp_%ID%", "ComponentID" : "%ID%", "ComponentTemplateID" : "tcm:XX-XXXXX-32", "Version" : 0, "IsQueryBased" : true  } --&gt;]]&gt;
  </code></pre>
  
  <p></p>
  
  <p>I am using this variable in loop </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;xsl:value-of select="XXXX:RegexStringReplace($SE_CP_MarkUP,'%ID%',@ID)" disable-output-escaping="yes"/&gt;
  </code></pre>
  
  <p>Please suggest what could be the issue?</p>
  
  <p>More Detail:</p>
  
  <p>Generated  HTML </p>
  
  <pre><code>    &lt;div&gt;
    &lt;!-- Start SiteEdit Component Presentation: {"ID" : "cp_tcm:13-287142", "ComponentID" : "tcm:13-287142", "ComponentTemplateID" : "tcm:13-286965-32", "Version" : 3, "IsQueryBased" : true  } --&gt;
    HTMLConent
  &lt;/div&gt;
  &lt;div&gt;
    &lt;!-- Start SiteEdit Component Presentation: {"ID" : "cp_tcm:13-287162", "ComponentID" : "tcm:13-287162", "ComponentTemplateID" : "tcm:13-286965-32", "Version" : 2, "IsQueryBased" : true  } --&gt;
    HTMLConent
  &lt;/div&gt;
  &lt;div&gt;
    &lt;!-- Start SiteEdit Component Presentation: {"ID" : "cp_tcm:13-287204", "ComponentID" : "tcm:13-287204", "ComponentTemplateID" : "tcm:13-286965-32", "Version" : 1, "IsQueryBased" : true  } --&gt;
    HTMLConent
  &lt;/div&gt;
  &lt;div&gt;
    &lt;!-- Start SiteEdit Component Presentation: {"ID" : "cp_tcm:13-287234", "ComponentID" : "tcm:13-287234", "ComponentTemplateID" : "tcm:13-286965-32", "Version" : 4, "IsQueryBased" : true  } --&gt;
    HTMLConent
  &lt;/div&gt;
  &lt;div&gt;
    &lt;!-- Start SiteEdit Component Presentation: {"ID" : "cp_tcm:13-287251", "ComponentID" : "tcm:13-287251", "ComponentTemplateID" : "tcm:13-286965-32", "Version" : 3, "IsQueryBased" : true  } --&gt;
    HTMLConent
  &lt;/div&gt;
  </code></pre>
  
  <p>SiteEdit Settings</p>
  
  <pre><code>&lt;!-- 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"}} --&gt;
  </code></pre>
  
  <p>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.</p>
  
  <p>Also there is no JS error on page.</p>
  
  <p>Thanks,
  Vikas Kumar</p>