Drupal7:具有多个字段的内容类型
Drupal 7 中处理多个字段(> 40)的最佳方式是什么? 我必须处理旅馆的内容类型。 D7 创建与字段数一样多的 mysql 表,所以我担心性能,但也许这不是问题。
我是否必须创建实体和子实体或创建模块来将一些数据存储在同一个表中(设备字段、服务字段、活动字段等) 或其他解决方案?
非常感谢您的建议!
what's the best way in Drupal 7 to handle many fields (> 40).
I've to handle hostels content-type.
D7 creates as many mysql tables as fields count, so I fear for the performances, but maybe it's not a problem.
Do I have to create entity and sub-entities or create modules to store some data in the same table (a field for equipments, a field for services, a field for activites, etc.)
or other solution ?
Many thanks for your advices !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
40 个字段并没有那么糟糕,因为我似乎有很多包含更多字段的数据库表。
Drupal 在面向对象和规范化方面并不是那么好,但您可以:
希望有帮助
40 fields are not that bad as I have seem plenty db tables with more fields.
Drupal is not really that good in OO and normalization but you can:
Hope that helps
您可以保持原样,因为您知道,在性能和灵活性之间,Drupal 选择了灵活性:)
如果您希望将所有这些存储在 1 个表中,可以编写实现自定义字段集的模块,如下所示: http://www.lullabot.com/articles/creating-custom-cck-fields
然而,它是针对 D6 的 - 我还没有为核心中带有 cck 字段的 D7 做过类似的事情,所以不能在这里给你指导。
我想,这个,特别是这可能会有所帮助。
You can leave it as is, because, you know, between performance and flexibility, Drupal chose flexibility:)
if you want to have all these stored in 1 table, it's possible to write module that implements custom fieldset, like this: http://www.lullabot.com/articles/creating-custom-cck-fields
however, it's for D6 - I haven't done similar thing for D7 with cck fields in core, so can't give you direction here.
I guess, this and particularly this might help.