我面临着一个问题,当加载使用剃刀模板使用DD4T创建的页面。
我已经使用DD4T模板向content broker发布了一个页面,并使用DD4T编写了一个Razor模板页面的脚本。
我在剃刀页面中添加了SiteEdit特定的评论。
我将siteEdit临时服务器url指向我托管DD4T应用程序的where服务器。
当我访问Razor页面时,siteEdit按钮是启用的,当我点击siteEdit按钮时,它开始初始化组件,并给出以下错误。

我猜这与DD4T模板有关,它给出了XML类的输出。
请帮帮忙。嗨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>发布于 2012-06-05 04:47:52
问题已经解决了。在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>
发布于 2012-06-02 21:55:31
您有一个不在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" }} -->https://stackoverflow.com/questions/10839577
复制相似问题