【问题标题】:SiteEdit DD4T Load ErrorSiteEdit DD4T 加载错误
【发布时间】:2012-06-06 01:30:51
【问题描述】:

我在加载使用 DD4T 使用 Razor 模板创建的页面时遇到问题。

我使用 DD4T 模板向内容代理发布了一个页面,并使用 DD4T 编写了一个 Razor 模板页面。

我在 Razor 页面中添加了 SiteEdit 特定评论。

我将 siteEdit 登台服务器 url 指向我托管 DD4T 应用程序的网络服务器。

当我访问 Razor 页面时,启用了 siteEdit 按钮,当我单击 siteEdit 按钮时,它开始初始化组件并给出以下错误。

我猜这与 DD4T 模板有关,它提供 xml 类型的输出。

请帮忙。 嗨 Quirijn,

这是我的 html 文件中的源代码。

嗨,奎林,

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

【问题讨论】:

  • 我不太确定它与 DD4T 模板有关。它们确实生成 XML,但 XML 由 DD4T 使用并由 Razor 模板转换为 HTML。然后 DD4T 所做的就是将 SiteEdit cmets 插入 HTML。能否请您发布页面的 HTML?
  • 嗨 Quirijn,我已经更新了帖子中的 html 源代码供您参考。我无法注意到源代码中的任何问题。请帮忙。

标签: tridion-2011 dd4t


【解决方案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>

【讨论】:

    【解决方案2】:

    您有一个 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" }} -->
    

    【讨论】:

    • 嗨,我已经完成了您建议的修改,但仍然是同样的错误。我使用的 siteedit 版本是 2009 SP1。正在使用的 siteEdit 标签是否正确?
    猜你喜欢
    • 2012-06-04
    • 2012-09-22
    • 2012-06-08
    • 2012-12-23
    • 2012-06-11
    • 2012-11-15
    • 2018-02-02
    • 2013-07-22
    • 1970-01-01
    相关资源
    最近更新 更多