1

I have crated two content type like A and B .some of field are similar .I don't want to repeat that field .I want to put drop down list on any one of A or B.

4
  • have u tried existing field in manage field ?
    – harshal
    Commented Oct 29, 2013 at 5:42
  • No I don't have idea of that Commented Oct 29, 2013 at 5:46
  • check the first part of the answer
    – harshal
    Commented Oct 29, 2013 at 5:49
  • got the thing ?
    – harshal
    Commented Oct 29, 2013 at 6:03

2 Answers 2

3

YOU should use the entity reference module for the above purpose.

Provides a field type that can reference arbitrary entities:

A generic entity reference field Four widgets: Two implemented on top of the Options module (Select and Radios/Checkboxes), Two autocomplete widgets (one with one text field per entry, one tag-style with comma-separated entries in the same text field) Two formatters: A "Label" formatter, with optional link that displays the label of the referenced entity (the node title, the user name, etc.) A "Rendered entity" formatter, that renders the references entity using a configurable view mode Integration with Views (for both forward and backward references) Integration with Entity Metadata (and as a consequence with Search API and the like) Integration with Devel generate Integration with Feeds and Migrate (>= 2.3) for painless data import This modules depends on Entity API and CTools.

Modules extending Entity reference functionality:

Earlier answer deleted following comments :
If you want to use the existing field then just go to manage fields tab under
Home » Administration » Structure » Content types » A
and use existing field option where you will get the existing field of other content type
Check the image below for existing field option :
enter image description here

Or else you can do it in the following way :

You can get your dropdown list for content type in $form_state['values']['your_field_name_for_dropdown'] and
and Save that value in $_SESSION['module_name']['your_field_name_for_dropdown'] After saving that value you can use that value to insert into another content type in the hook_form_alter function or your custom_form itself.

7
  • ok but I dont want to add content of that field second time .what ever I added in side A it should be all display on B as drop down list. Commented Oct 29, 2013 at 5:56
  • that is why you should use existing field so that you dont need to add again
    – harshal
    Commented Oct 29, 2013 at 5:57
  • Suppose I have added five page in one content type A,all information is should be display as drop down list in content type B pages, from that I select any of them Commented Oct 29, 2013 at 5:58
  • so do you mean you want the content type as options?
    – harshal
    Commented Oct 29, 2013 at 5:59
  • Yes I need content type option Commented Oct 29, 2013 at 6:00
0

Simply go to /admin/structure/types/manage/<your-content-type>/fields and at the end of page you will find a 2 options : Add new field, and Add existing field

Use Add existing field to add a field from one content type in another content type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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