Skip to main content
Clarity edit & tag
Source Link
Shawn Conn
  • 26.9k
  • 15
  • 49
  • 73

I need to programmatically save some field data (when aduring node of type A is savedsave I want to take the data from type A's title and& path alias and put them intostore it in a link field called field_alternative_titles_titlefield_alternative_titles_title), I have just started recently getting into the programming side of Drupal, and I am not sure what function is the right one to do that.

Which functions can I did some research, is field_attach_insert the functionuse here? Do I would calluse field_attach_insert or hook_field_storage_pre_insert to take that title and path alias and save them to mythe link field?

Or would hook_field_storage_pre_insert be the function to do that?

I need to programmatically save some field data (when a node of type A is saved I want to take the data from type A's title and path alias and put them into a link field called field_alternative_titles_title), I have just started recently getting into the programming side of Drupal, and I am not sure what function is the right one to do that.

I did some research, is field_attach_insert the function I would call to take that title and path alias and save them to my link field?

Or would hook_field_storage_pre_insert be the function to do that?

I need to programmatically save field data (during node save I want to take the title & path alias and store it in a link field called field_alternative_titles_title).

Which functions can I use here? Do I use field_attach_insert or hook_field_storage_pre_insert to save the link field?

added 74 characters in body; edited title
Source Link
Eluchel
  • 387
  • 3
  • 17

How to use field_attach_insert?save field data

I need to programmatically save some field data (when a node of type A is saved I want to take the data from type A's title and path alias and put them into a link field called field_alternative_titles_title), I have just started recently getting into the programming side of Drupal, and I am not sure what function is the right one to do that. 

I did some research, is field_attach_insert the function I would call to take that title and path alias and save them to my link field?

Or would hook_field_storage_pre_insert be the function to do that?

How to use field_attach_insert?

I need to programmatically save some field data (when a node of type A is saved I want to take the data from type A's title and path alias and put them into a link field called field_alternative_titles_title), I have just started recently getting into the programming side of Drupal, and I am not sure what function is the right one to do that. I did some research, is field_attach_insert the function I would call to take that title and path alias and save them to my link field?

How to save field data

I need to programmatically save some field data (when a node of type A is saved I want to take the data from type A's title and path alias and put them into a link field called field_alternative_titles_title), I have just started recently getting into the programming side of Drupal, and I am not sure what function is the right one to do that. 

I did some research, is field_attach_insert the function I would call to take that title and path alias and save them to my link field?

Or would hook_field_storage_pre_insert be the function to do that?

updated to make more clear
Source Link
Eluchel
  • 387
  • 3
  • 17

How to programmatically populate an instance of a fielduse field_attach_insert?

I am not sure what the proper Drupal jargon is for this, I have aneed to programmatically save some field data (field_alternative_titles_title), I want to write some code so that whenwhen a new node of type (disease_topic)A is created thatsaved I canwant to take the data from type A's title and path alias of the node and populate the field_alternative_titles_titleput them into a link field. What called field_alternative_titles_title), I have just started recently getting into the programming side of Drupal, and I am not sure what function is the coderight one to do that?

The field_alternative_titles_title field. I did some research, is in a collection (field_alternative_titles)field_attach_insert the function I would call to take that is connectedtitle and path alias and save them to the content type disease_topic.my link field?

How to programmatically populate an instance of a field?

I am not sure what the proper Drupal jargon is for this, I have a field (field_alternative_titles_title), I want to write some code so that when a new node of type (disease_topic) is created that I can take the title and path alias of the node and populate the field_alternative_titles_title field. What is the code to do that?

The field_alternative_titles_title field is in a collection (field_alternative_titles) that is connected to the content type disease_topic.

How to use field_attach_insert?

I need to programmatically save some field data (when a node of type A is saved I want to take the data from type A's title and path alias and put them into a link field called field_alternative_titles_title), I have just started recently getting into the programming side of Drupal, and I am not sure what function is the right one to do that. I did some research, is field_attach_insert the function I would call to take that title and path alias and save them to my link field?

Source Link
Eluchel
  • 387
  • 3
  • 17
Loading