4

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 !

Etienne
  • 655
  • 3
  • 15

2 Answers2

1

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:

  • Create multiple custom content type and link them via Corresponding Node References to mimic the entity relationship, foreign key.
  • use taxonomy
  • write you own module never hurts as it help you learn the Druapl way.

Hope that helps

Will
  • 900
  • 10
  • 20
1

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.

32i
  • 626
  • 4
  • 12