gpt4 book ai didi

tridion - 向组件模板添加启用内联编辑后预览组件时出错

转载 作者:行者123 更新时间:2023-12-04 05:47:30 24 4
gpt4 key购买 nike

我正在为 SDL Tridion 2011 SP1 中 Dreamweaver TBB 中的组件启用 SiteEdit 2009。

内容 XML:

<Content>
<AAA>
<BBB>
<CCC>Title 1</CCC>
<DDD>Name 1</DDD>
</BBB>
<BBB>
<CCC>Title 2</CCC>
<DDD>Name 2</DDD>
</BBB>
</AAA>

<AAA>
<BBB>
<CCC>Title 1</CCC>
<DDD>Name 1</DDD>
</BBB>
<BBB>
<CCC>Title 2</CCC>
<DDD>Name 2</DDD>
</BBB>
</AAA>

</Content>

字段的描述是:
  • AAA - 可重复的嵌入式架构
  • BBB - AAA 内的可重复嵌入架构

  • Dreamweaver TBB 是:
    <!-- TemplateBeginRepeat name="AAA" -->

    <!-- TemplateBeginRepeat name="Field.BBB" -->
    <div>@@RenderComponentField(FieldPath+".CCC", 0)@@ </div>
    <div>@@RenderComponentField(FieldPath+".DDD", 0)@@ </div>
    <!-- TemplateEndRepeat -->

    <!-- TemplateEndRepeat -->

    我在组件模板中添加了这个 TBB 并预览了组件。它显示了没有错误的确切预览。

    我的组件模板的高级源如下所示:
    <TemplateInvocation>Dreamweaver TBB</TemplateInvocation>
    <TemplateInvocation>Enable Inline Editing</TemplateInvocation>

    当我将 SiteEdit 2009 的“启用内联编辑”添加到组件模板时,它显示以下错误:
    Debugging was started in process 'TcmTemplateDebugHost' with id 9244
    Object reference not set to an instance of an object.
    at Tridion.ContentManager.Templating.Templates.EnableInlineEditing.FindItemFieldXPath(String[] parts, Int32 currentIndex, ItemFields fields, Boolean& isMultiValue)
    at Tridion.ContentManager.Templating.Templates.EnableInlineEditing.FindItemFieldXPath(String[] parts, Int32 currentIndex, ItemFields fields, Boolean& isMultiValue)
    at Tridion.ContentManager.Templating.Templates.EnableInlineEditing.FindItemFieldXPath(String[] parts, Int32 currentIndex, ItemFields fields, Boolean& isMultiValue)
    at Tridion.ContentManager.Templating.Templates.EnableInlineEditing.DetermineXPathForField(TcmUri componentUri, String fieldName, Boolean& isMultiValue)
    at Tridion.ContentManager.Templating.Templates.EnableInlineEditing.ProcessComponentFieldTag(ITcdlTag tag)
    at Tridion.ContentManager.Templating.TcdlParser.ProcessText(String text, TagHandler tagHandler, Boolean& wasModified)
    at Tridion.ContentManager.Templating.TcdlParser.ProcessText(String text, TagHandler tagHandler)
    at Tridion.ContentManager.Templating.TcdlParser.Process(Item item, TagHandler tagHandler)
    at Tridion.ContentManager.Templating.Assembly.AssemblyMediator.Transform(Engine engine, Template template, Package package)
    at Tridion.ContentManager.Templating.Assembly.CSharpSourceCodeMediator.RunTemplate(Engine engine, Package package, String templateUri, String className)
    at Tridion.Templating.CSharpTemplate.CSharpSourceTemplate.Transform(Engine __engine, Package __package)
    at Tridion.ContentManager.Templating.Assembly.CSharpSourceCodeMediator.Transform(Engine engine, Template template, Package package)
    at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package)
    at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template)
    at Tridion.ContentManager.Templating.Compound.CompoundTemplateMediator.Transform(Engine engine, Template templateToTransform, Package package)
    at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package)
    at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template)
    at Tridion.ContentManager.Templating.Engine.TransformPackage(Template template, Package package)
    at Tridion.ContentManager.Templating.Debugging.DebuggingEngine.Run()
    at Tridion.ContentManager.Templating.Debugging.DebugSession.Run()

    任何人都可以分享他们对此的看法吗?

    它是 SiteEdit 2009 的限制吗?

    最佳答案

    看起来您已经阅读了这个答案并尝试应用它:How to handle nested repeating regions in Dreamweaver TBBs in SDL Tridion 2011 SP1

    在这种情况下,您是否也遵循了该答案中的调试提示?如果是这样,你看到的输出是什么?

    Many people have problems writing constructs like these. I am no exception, I have just found that I can get most cases working by knowing that the crucial variables are: Field, FieldPath and TemplateRepeatIndex. When in doubt, simply embed this fragment into your DWT inside every TemplateBeginRepeat.



    (FieldPath=@@FieldPath@@, TemplateRepeatIndex=@@TemplateRepeatIndex@@)

    关于tridion - 向组件模板添加启用内联编辑后预览组件时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10494064/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com