how to pass embedded schemas as drop down for the content schema in SDL Tridion 2011 SP1

无人久伴 提交于 2019-12-05 13:08:27

I don't believe this is supported using the out of the box SDL Tridion Web Schemas (Although a number of great undocumented schema changes have crept into the product lately) . Tridion Web Schemas use a sequence in the XSD to control the order (and numbers) of the fields which prevents you from having a multi-value field with two types of Embedded Schema. You could however use a complex schema (i.e. model your data yourself by designing your own schema or modifying one you built using the GUI using the source tab), but would likely longer be able to use the GUI to edit your content.

Is there anyway you could use a multi-value Component Link field rather than an Embedded Schema? That way you can link the field to items of type AAAA or ABCD and put them in any order you want.

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!