1

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>
user1357019
  • 215
  • 2
  • 7
  • I'm not so sure it has to do with the DD4T templates. They do produce XML, but the XML is consumed by DD4T and converted to HTML by the Razor templates. All DD4T then does is insert the SiteEdit comments into the HTML. Can you please post the HTML of the page? – Quirijn Jun 01 '12 at 09:07
  • Hi Quirijn, I have updated the html source in the post for your reference. i am not able to notice any issue in the source. please help. – user1357019 Jun 01 '12 at 23:54

2 Answers2

1

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>

user1357019
  • 215
  • 2
  • 7
0

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" }} -->
Quirijn
  • 3,549
  • 15
  • 30
  • hi i have done the modification you suggested but still the same error. The siteedit version which i am using is 2009 SP1. Is the siteEdit tag which am using is correct ? – user1357019 Jun 03 '12 at 21:16