2012-05-31 20 views
1

我在使用DD4T加載使用Razor模板創建的頁面時遇到了一個問題。SiteEdit DD4T加載錯誤

我已經使用DD4T模板向內容代理髮布了一個頁面,並且我使用DD4T編寫了一個Razor模板頁面。

我在Razor頁面中添加了SiteEdit特定的評論。

我將siteEdit臨時服務器url指向我的web服務器,我託管了我的DD4T應用程序。

當我訪問Razor頁面時,siteEdit按鈕被啓用,當我點擊siteEdit按鈕時,它開始初始化組件,並給出下面的錯誤。

enter image description here

我想這事做DD4T模板這使得XML類型的輸出。

請幫忙。 Hi Quirijn,

這是我的HTML文件中的源代碼。

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> 
+0

我不敢肯定它與DD4T模板做。他們製作XML,但XML由DD4T使用並由Razor模板轉換爲HTML。 然後,所有DD4T都將SiteEdit註釋插入到HTML中。 您可以發佈頁面的HTML嗎? – Quirijn

+0

Hi Quirijn, 我已更新該帖子中的html源代碼供您參考。 我無法注意到來源中的任何問題。 請幫忙。 – user1357019

回答

1

問題已解決。添加標籤並從DD4T的PageSiteEdit中刪除藍圖屬性已經解決了這個問題。

修改後的源代碼如下所示。

<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> 

0

你有SiteEdit元件領域的標記是不是SiteEdit組件演示中。這是不正確的,因爲SiteEdit應該如何知道該字段屬於哪個組件? 我的猜測是這是導致你的問題。你可以試試這個嗎?

<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" }} --> 
+0

hi 我已經完成了您所建議的修改,但仍然出現同樣的錯誤。 我使用的siteedit版本是2009 SP1。正在使用的siteEdit標籤是否正確? – user1357019