After hearing the lullabot podcast 38 (which deprecates almost everything except CCK & Views) and reading about the CCK database architecture, I strongy recommend adding internal field names - they are greatly missing for non-English CCK fields. Without them, all fields names look like underscores.

Details

Currently, for each content type you must define a a machine readable name. This is great! since it serves as a part of the table name created for that content type.

Problem is no such concept exist for the field names.

Suggestion: Carry this excellent contcept to the field level! Allow the user to define a machine readable name for each field as well.

Otherwise, when I define my Hebrew field names for my new content type, and look at the DB table, all I get is underscores, which is not very friendly. Field names are *completely* erased, which was not the original intention.

Here is how my 'directory' CCK table looks: Excellent internal name for the table, but only underscores for the field names.

Fixing it will be a great improvement to the CCK data model and will enable easier internationalization.


mysql>  desc content_type_directory;     
+------------------------+------------------+------+-----+---------+-------+
| Field                  | Type             | Null | Key | Default | Extra |
+------------------------+------------------+------+-----+---------+-------+
| vid                    | int(10) unsigned |      | PRI | 0       |       |
| nid                    | int(10) unsigned |      |     | 0       |       |
| field___url            | varchar(255)     |      |     |         |       |
| field___title          | varchar(255)     |      |     |         |       |
| field___attributes     | mediumtext       |      |     |         |       |
| field__page_rank_value | int(11)          | YES  |     | NULL    |       |
| field___0_url          | varchar(255)     |      |     |         |       |
| field___0_title        | varchar(255)     |      |     |         |       |
| field___0_attributes   | mediumtext       |      |     |         |       |
| field___1_value        | int(11)          | YES  |     | NULL    |       |
| field___4_value        | longtext         |      |     |         |       |
+------------------------+------------------+------+-----+---------+-------+
11 rows in set (0.00 sec)

Thanks

Amnon
-
Professional: Drupal Search | Drupal Israel | Web Hosting Strategies
Personal: Hitech Dolphin: Regain Simple Joy :)

Comments

druvision’s picture

Better formatted table:

mysql>  desc content_type_directory;     
+------------------------+------------------+------+-----+---------+-------+
| Field                  | Type             | Null | Key | Default | Extra |
+------------------------+------------------+------+-----+---------+-------+
| vid                    | int(10) unsigned |      | PRI | 0       |       |
| nid                    | int(10) unsigned |      |     | 0       |       |
| field___url            | varchar(255)     |      |     |         |       |
| field___title          | varchar(255)     |      |     |         |       |
| field___attributes     | mediumtext       |      |     |         |       |
| field__page_rank_value | int(11)          | YES  |     | NULL    |       |
| field___0_url          | varchar(255)     |      |     |         |       |
| field___0_title        | varchar(255)     |      |     |         |       |
| field___0_attributes   | mediumtext       |      |     |         |       |
| field___1_value        | int(11)          | YES  |     | NULL    |       |
| field___4_value        | longtext         |      |     |         |       |
+------------------------+------------------+------+-----+---------+-------+
11 rows in set (0.00 sec)
drifter’s picture

What I usually do is I first name the columns in plain English (that sets the internal field names in the database and elsewhere), and then I go back and rename them to Hungarian. The internal names will remain in English. So the capability is already there, it just needs to be made clear in the UI.

druvision’s picture

Version: 5.x-1.3 » 5.x-1.5
Status: Active » Closed (fixed)

I tried it in the new CCK version (1.5) and it seems to work OK now - the internal field name is now exposed and added correctly even if I do it the first time.

druvision’s picture

I tried it in the new CCK version (1.5) and it seems to work OK now - the internal field name is now exposed and added correctly even if I do it the first time.