且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将嵌入式架构作为下拉列表传递给SDL Tridion 2011 SP1中的内容架构

更新时间:2022-01-24 00:19:26

如果您希望停留在Tridion Web Schema的范围之内,这确实是不可能的.正如Chris所解释的,如果您开始为此使用复杂模式,则您将失去基于表单的UI来编辑组件.

If you want to stay within the realm of Tridion Web Schemas this is indeed not possible. As Chris explained, if you start using a Complex Schema for this, you loose the form based UI for editing a Component.

我能想到的唯一解决方案是将ABCD和AAAA的所有字段添加到可嵌入模式中,并使所有内容都不是强制性的.如果内容验证很重要,那么您可以实现一个事件系统,该系统对组件的保存进行检查.在这里,您可以进行条件检查,如果构成可嵌入模式的ABCD部分的字段被填充,它将被忽略甚至可以清除AAAA字段,反之亦然.

Only solution I can think of is to add all fields of ABCD and AAAA to an embeddable Schema and make everything non mandatory. If content validation is important, then you can implement an event system which does the check on save of the Component. In here you could do conditional checks, if the fields form the ABCD part of your embeddable schema are filled it will ignore or can even clear the AAAA fields and vice versa.

您的模板代码现在需要决定要显示的内容.如果可填充模式上的所有字段都已填写,则需要选择要显示的内容,否则只能显示输入的内容.您应该在可嵌入模式的字段描述中明确模板的逻辑,以便可以指导内容编辑器确定在哪种情况下需要什么内容(保存时由事件系统支持以验证正确性).

Your template code will now need to make the decision on what content to show. If all of the fields on the embeddable schema are filled, it needs to make a choice on what to show, otherwise it can show just the content which is entered. You should make the logic of the template clear in the field description of the embeddable Schema, so you can guide the Content Editor into what content is required in which scenario (supported by an event system on save to validate the correctness).