SiteEdit DD4T Load Error

313 views Asked by At

I am facing an issue while loading the Page created using Razor Template using DD4T.

I have published a page to content broker using DD4T Templates and I scripted a Razor template page using DD4T.

I added the SiteEdit specific coments in the Razor page.

I pointed the siteEdit staging server url to my webserver where i hosted my DD4T application.

When i accessed the Razor page the siteEdit button was enabled and when i clicked on siteEdit button it started initializing the component and give the below error.

enter image description here

I guess this something to do with DD4T Templates which gives xml kind of output.

Please help. Hi Quirijn,

this is the source in my html file.

Hi Quirijn,

<!DOCTYPE html>
<html>
<head>
    <title>News</title>
    <link href="/FirstDD4TMVCApplicationsiteedit/Content/Site.css" rel="stylesheet" type="text/css" />
    <script src="/FirstDD4TMVCApplicationsiteedit/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<link href="/SiteEdit/App_Themes/SiteEdit/Calendar.css" type="text/css" rel="stylesheet" /><link href="/SiteEdit/App_Themes/SiteEdit/SiteEditBorders.css" type="text/css" rel="stylesheet" /></head>

<body>


<div>
<div> 
  <!-- Start SiteEdit Component Presentation: {"ID" : "CP0", "ComponentID" : "tcm:8-31855", "ComponentTemplateID" : "tcm:8-31851-32", "ComponentVersion" : 1, "IsQueryBased" : false, "SwapLabel" : "default" } --> 
</div> 
<div> 
  <!-- Start SiteEdit Component Field: {"ID" : "ContentHeading1", "IsMultiValued" : true, "XPath" : "tcm:Content/custom:Content/custom:Heading[1]" } --> 
 TestNews 
</div> 
</div>
<!-- SiteEdit Settings: {"PageID":"tcm:8-31856-64", "PageVersion":2, "ComponentPresentationLocation":1, "BluePrinting" : {"PageContext" : "tcm:0-0-1", "ComponentContext" : "tcm:0-8-1", "PublishContext" : "tcm:0-8-1" }} -->  
</body>
</html>
2

There are 2 answers

0
user1357019 On BEST ANSWER

The problem has been solved. Adding tag and removing blueprint attribute from PageSiteEdit of DD4T had solved the problem.

The modified source looks like below.

 <div> <span> <!-- Start SiteEdit Component Presentation: {"ID" : "CP0", "ComponentID" : "tcm:8-31855", "ComponentTemplateID" : "tcm:8-31851-32", "ComponentVersion" : 1, "IsQueryBased" : false, "SwapLabel" : "default" } -->


    <span>

 <h2> <!-- Start SiteEdit Component Field: {"ID" : "ContentHeading1", "IsMultiValued" : true, "XPath" : "tcm:Content/custom:Content/custom:Heading[1]" } -->
   TestNews
</h2>
</span>

1
Quirijn On

You have a SiteEdit Component Field markup which is not inside a SiteEdit Component Presentation. This is incorrect, because how is SiteEdit supposed to know to which component the field belongs? My guess is that this is causing your problem. Can you try this instead?

<div> 
  <!-- Start SiteEdit Component Presentation: {"ID" : "CP0", "ComponentID" : "tcm:8-31855", "ComponentTemplateID" : "tcm:8-31851-32", "ComponentVersion" : 1, "IsQueryBased" : false, "SwapLabel" : "default" } --> 
  <div> 
    <!-- Start SiteEdit Component Field: {"ID" : "ContentHeading1", "IsMultiValued" : true, "XPath" : "tcm:Content/custom:Content/custom:Heading[1]" } --> 
 TestNews 
  </div>
</div> 
<!-- SiteEdit Settings: {"PageID":"tcm:8-31856-64", "PageVersion":2, "ComponentPresentationLocation":1, "BluePrinting" : {"PageContext" : "tcm:0-0-1", "ComponentContext" : "tcm:0-8-1", "PublishContext" : "tcm:0-8-1" }} -->