条件字段和视图
我有五个多组字段,每个字段都由具有 1 到 5 值的条件字段显示。例如,如果我选择 2,则会出现一个选择列表字段,其中包含所选数据,如果我选择 1,则会出现另一个选择列表字段,其中包含另一选择数据。
如何使用 wiews 仅显示条件字段所选值的内容。
谢谢。
I have five multigroup fields each one are displayed by a conditional field with a 1 to 5 value. If I select for example 2 there's a select list field appearing with is selected data , if i select 1 there's another one with an another select data.
How do I display with wiews only the content of the choosen value of the conditional field.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是在主题中创建逻辑。执行此操作的方法有很多种,一种是添加所有可能的字段,但将它们排除在显示之外,并且仅显示条件字段。在视图的预处理函数之一中,您可以检查条件字段的原始数据,并用要显示的字段的值替换该字段或仅替换主题值。
The simplest way of doing this, would be to create the logic in your theme. There are many ways of doing this, one would be to add all of the possible fields, but exclude them from display, and only show the conditional field. In one of the preprocess functions for the view, you could check the raw data for the conditional field, and replace either the field, or just the the themed value, with the value of the field you want to display.