Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

I had a similar question these days, and I tried to see if the Features module could help. Features worked to me.

You can create the field by the UI and then export a feature with the address field already created.
After that you can move the inc files for your custom module and add an include on your .module file:

include_once('[your_module].features.inc');

Then, you will need to add the some lines on your .info from the info file of the exported feature.

Your info file will need something like this:

dependencies[] = "features"    
dependencies[] = "text"
    
features[field][] = "node-article-field_address"

This question may help you too: Develop a module that adds a new content type with custom fieldsDevelop a module that adds a new content type with custom fields.

I had a similar question these days, and I tried to see if the Features module could help. Features worked to me.

You can create the field by the UI and then export a feature with the address field already created.
After that you can move the inc files for your custom module and add an include on your .module file:

include_once('[your_module].features.inc');

Then, you will need to add the some lines on your .info from the info file of the exported feature.

Your info file will need something like this:

dependencies[] = "features"    
dependencies[] = "text"
    
features[field][] = "node-article-field_address"

This question may help you too: Develop a module that adds a new content type with custom fields.

I had a similar question these days, and I tried to see if the Features module could help. Features worked to me.

You can create the field by the UI and then export a feature with the address field already created.
After that you can move the inc files for your custom module and add an include on your .module file:

include_once('[your_module].features.inc');

Then, you will need to add the some lines on your .info from the info file of the exported feature.

Your info file will need something like this:

dependencies[] = "features"    
dependencies[] = "text"
    
features[field][] = "node-article-field_address"

This question may help you too: Develop a module that adds a new content type with custom fields.

deleted 4 characters in body
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

I had a similar question thisthese days, and I tried to see if the featuresFeatures module could help. Features worked to me.

You can create the field by the UI and then export a feature with the address field already created.

After
After that you can move the inc files for your custom module and add an include on your .module file:

include_once('[your_module].features.inc');

Then, you will need to add the some lines on your .info from the info file of the exported feature.

Your info file will need something like this:

dependencies[] = "features"    
dependencies[] = "text"
    
features[field][] = "node-article-field_address"

This question may help you too: Develop a module that adds a new content type with custom fields.

Develop a module that adds a new content type with custom fields

I had a similar question this days and I tried to see if the features module could help. Features worked to me.

You can create the field by the UI and then export a feature with the address field already created.

After that you can move the inc files for your custom module and add an include on your .module file:

include_once('[your_module].features.inc');

Then you will need to add the some lines on your .info from the info file of the exported feature.

Your info file will need something like this:

dependencies[] = "features"    
dependencies[] = "text"
    
features[field][] = "node-article-field_address"

This question may help you too.

Develop a module that adds a new content type with custom fields

I had a similar question these days, and I tried to see if the Features module could help. Features worked to me.

You can create the field by the UI and then export a feature with the address field already created.
After that you can move the inc files for your custom module and add an include on your .module file:

include_once('[your_module].features.inc');

Then, you will need to add the some lines on your .info from the info file of the exported feature.

Your info file will need something like this:

dependencies[] = "features"    
dependencies[] = "text"
    
features[field][] = "node-article-field_address"

This question may help you too: Develop a module that adds a new content type with custom fields.

Source Link
revagomes
  • 648
  • 3
  • 20

I had a similar question this days and I tried to see if the features module could help. Features worked to me.

You can create the field by the UI and then export a feature with the address field already created.

After that you can move the inc files for your custom module and add an include on your .module file:

include_once('[your_module].features.inc');

Then you will need to add the some lines on your .info from the info file of the exported feature.

Your info file will need something like this:

dependencies[] = "features"    
dependencies[] = "text"
    
features[field][] = "node-article-field_address"

This question may help you too.

Develop a module that adds a new content type with custom fields