0

In the drop-down for "add existing field" not all fields are available for reuse. Specifically I would like to reuse a field of type "list (integer)" because I will be adding 300 of them to my content type with exactly the same settings (just different labels and machine names). Doing the manually is going to take me over eight hours since it takes about 1.5 min to add a field and configure it's settings. Is it possible to reuse fields of type "list (integer)"?

Thanks!!

ps: if you are unsure what I mean by reusing a field see here: Documentation for Field-UI and look at the section titled, "Reusing Fields".

  • All fields normally can be shared between entity types. If you would like to add many instances of one field to one content type you can use API field_create_field() & field_create_instance() functions. – Oleg Sherbakov Jul 14 '13 at 18:14
  • Thank you, Oleg, for your reply. At the moment I have one content type that I am working with. I have added 40 fields of type "list (integer)" one-by-one. I agree with what you said, "all fields normally can be shared between entity types." I wonder why the field does not show up in the drop-down for "add existing field". Could perhaps fields of type "list (integer)" not be able to be shared? – Nourished Jul 14 '13 at 23:35
  • Because I have already added 40 similar fields to the content type should I delete 39 of them and then use the function "field_create_instance()" to add 299 instances the field so that they are actually "shared"? Because the field has already been created through the GUI will "field_create_field()" still be needed? – Nourished Jul 14 '13 at 23:41
1

Here's the answer to this question:

I cannot use the same field within one content type. Only one instance of a field may be used within each content type. This is why the field which I have created is not showing up in the drop-down for "add existing field" - it is not available.

0

As you say, you can only have one instance of a field in each content type. To share a list of options between multiple fields of a content type (say, a list of colours for 'background colour' and 'foreground colour' fields), I think your best bet would be to set up a separate content type ('Colour' in this example) and then create multiple entity reference fields that point to it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.