Adding a new node type programmatically from .install file.
Great video on adding a new node type with a module.
Got everything to work on my residential listing node type except I'm stuck on how to set the precision and scale for a decimal field (e.g. decimal 12,6). And I don't know how to set the length of a text field. Here's two of the fields I need to modify:
How would I set the field_r_longitude to decimal 12,6 and how would I set field_r_public_remarks to hold up to 1000 characters?
As easy as these settings were -- I had a hard time tracking down this info. But I think I'm getting used to using Chris's trick of searching through the site files with Komodo and looking for clues in the code itself.
I also found this example for installing a custom node type demonstrating presets for several field types http://davsblog.me/drupal-7-field-api-setup-a-new-content-type-o
Thank you so much Mark for posting your progress on this, nice work! I'm wondering if there's anything documented for those field settings. I'll have to do some fishing at some point and see if I can dig something up. Or, if you find something, please post back here.
Cheers!
Chris
I got the decimal field working by changing the code to:
'field_name' => 'field_r_long',
'type' => 'number_decimal',
'settings' => array('precision' => 12, 'scale' => 6, 'decimal_separator' => '.'),
'cardinality' => 1,
Probably the text field setting is obvious, but not to me yet.