如何将嵌入式架构作为下拉列表传递给SDL Tridion 2011 SP1中的内容架构 [英] how to pass embedded schemas as drop down for the content schema in SDL Tridion 2011 SP1

查看:95
本文介绍了如何将嵌入式架构作为下拉列表传递给SDL Tridion 2011 SP1中的内容架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在SDL Tridion中创建一个架构来满足这些要求.

I am trying to create a schema in SDL Tridion to satisfy these requirements.

我有两个主要领域:

  1. ABCD,其中一个子字段为"XYZ"
  2. AAAA,其中有两个子字段,即名称"和值"

两个主字段都是可重复的,并且应该是可移动的.

Both main fields are repeatable and and should be movable.

示例样式可能符合要求

ABCD----AAAA----ABCD---AAAA
AAAA----ABCD----ABCD----AAAA

应将主要字段AAAA和ABCD从一个移到另一个.

The main fields AAAA and ABCD should be moved from one to another.

假设我创建的组件具有已创建的架构,并且第一个主字段为"AAAA",第二个字段为"ABCD",那么我应该能够将ABCD移到AAAA上方.

Say if I create a component with the created schema and the first main fields as "AAAA" and second field as "ABCD", then I should be able to move ABCD above the AAAA.

我尝试创建具有两个字段的嵌入式架构:

I have tried creating an embedded schema with two fields:

  1. 选择主字段:在列表中,我选择ABCD和AAAA作为TEXT类型.

  1. select Main field: As a list, where I select either ABCD and AAAA as a TEXT type.

文本:输入文本.

将此模式作为内容模式的一部分添加为内容模式,以允许重新发布和重复".

Added this schema as part of content schema as multivalued which allows "reposting and repeating".

面临的问题:

  • 由于这两个主字段都不是通用字段,因此我无法为其输入数据,并且两个主字段的通用子字段也不能满足需要..

所需解决方案:

  • 如果我在必填字段中创建了两个名为"ABCD"和"AAAA"的嵌入式模式,是否可以将这些模式作为下拉列表添加到主内容模式中?

  • If I create two embedded schemas with the names "ABCD" and "AAAA" with the required fields, can I add these schemas as part of drop down in the main content schema?

如果用户选择嵌入式模式"ABCD",则应仅显示"XYZ"字段.如果用户选择"AAAA",则应将其子字段显示为名称"和值".

If user selects embedded schema "ABCD", it should display only "XYZ" field. If user selects "AAAA", i should display its subfields as "Name" and "Value".

如果这不可行,请提出最佳解决方案以满足要求?

If this is not feasible can you please suggest the best possible to solution to meet the requirement?

我正在将DWT TBB和XSLT TBB用作演绎部分.

I am using DWT TBB and XSLT TBB for rendition part.

谢谢.

推荐答案

如果您希望停留在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).

这篇关于如何将嵌入式架构作为下拉列表传递给SDL Tridion 2011 SP1中的内容架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆