In Drupal 7, I am looking to create a field in a content type that can either reference another specific content type and/or also reference a user. I am creating the content type programmatically in the .install file and am looking to be able to reference both types in the same field.
It currently works with one or the other as:
'field_sport_team_members' => array(
'field_name' => 'field_sport_team_members',
'label' => 'Team Members',
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
'type' => 'node_reference',
'description' => 'The members of the team',
'weight' => '3.5',
'required' => 0,
'settings' => array(
'referenceable_types' => array('club_person'),
),
),
for the reference to the content type and
'field_club_person_user' => array(
'field_name' => 'field_sport_team_members',
'type' => 'user_reference',
'label' => 'Team Members',
'description' => 'If this entry corresponds to a user, you can select the user here.',
'weight' => '3',
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
'translatable' => TRUE,
'locked' => FALSE,
'settings' => array(
'referenceable_roles' => array (
4 => '4', //captain
5 => '5', //player
),
'referenceable_status' => array(
1 => '1',
0 => 0,
),
),
),
for the reference to the user type.
I guess my real question is now with the advent of "entities", is it possible to make a entity reference, but also to specify which content types to search for as well?