Questions tagged [drupal-fields]

Fields are custom data that can be attached to Drupal entities.

Fields are custom data that can be attached to Drupal entities.

Drupal 7 provides an API that takes care of storing, loading, editing, and rendering field data. Any entity type (node, user, etc.) can use the Field API to make itself "fieldable" and thus allow fields to be attached to it. Other modules can provide a user interface for managing custom fields via a web browser as well as a wide and flexible variety of data type, form element, and display format capabilities.
In Drupal 6, most of the field functionalities are provided by CCK.

Use for questions about the Drupal 7 field API, how to use it, and which hooks need to be implemented from modules defining new fields.

See also

83 questions
1
vote
1 answer

How to programmatically set a conditional field with OR functionality in Drupal 7

In mymodule_form_alter() I am programmatically setting states for my conditional fields. I.E. $form['my_field_one']['#states'] = array( 'visible' => array( ':input[name="my_dependee_field[und]"]' => array('value' =>…
MTsrb
  • 377
  • 1
  • 5
  • 11
1
vote
1 answer

Drupal 7 - how to allow file extensions for field

After creating multiple fields with the help of the installation profile I am now also trying to figure out how I can add the allowed file extensions in the installation profile. Here is my code so far: 'name' => 'attachment', 'type' =>…
mparryy
  • 384
  • 2
  • 18
1
vote
2 answers

Drupal 7 conditionally check a field

I'm trying to write a conditional statement in a template file to check if the value of a 'node reference' field is not equal to a certain value. This is what I have so far:
TSDenley
  • 13
  • 1
  • 3
1
vote
1 answer

Alter Drupal 7 Text list values when you don't know position of text list in form array

I am creating a module to alter the output of Drupal 7 text list fields. I know that I can use hook_form_alter to do this, the problem is that the text field is output in different forms in different places and at different depths in the array…
Leo Pitt
  • 69
  • 1
  • 3
1
vote
3 answers

Drupal: Auto number field for content-type with starting value

I need a field which autonumbers my content-type, but starts at some value like 2000. I tried Serial Field and Computed Field. Couldn`t figure out how to do it. The number (using Serial Field) does automatically increment, but I cannot define a…
user1281146
  • 167
  • 3
  • 17
1
vote
2 answers

Content Taxonomy along with Conditional Fields

I'm still young at Drupal.So please correct me wherever needed. I have a requirement wherein I want my content type to have my own fields (achieved with CCK), then I want one of the fields to be a selectable drop down and each drop down value should…
Niks
  • 4,802
  • 4
  • 36
  • 55
1
vote
1 answer

Drupal 6 to 7; returning keys instead of label

I recently upgraded from Drupal 6 to 7 and on my node pages it is now returning the keys for each selected custom field, instead of the label. This is only happening for "Select list" fields. For example, the field "Price" is entered as…
1
vote
1 answer

Creating rule based on field collection field

What I want to do is trigger an action when one of the fields on my field collection is changed to a certain value. For example, my 'campaign' node has a field collection with a field called 'status' This status is a list containing 3 options;…
Rich Stevens
  • 599
  • 4
  • 17
1
vote
1 answer

Drupal 7 access field collection data in views

I have a field collection called field_logo_logos. There are 2 fields within: field_logo_image and field_logo_link In views I can get the data and it comes out like this:
Cybercampbell
  • 2,486
  • 11
  • 48
  • 75
1
vote
1 answer

printing all the "articles" related to the content type

my content type, plan to have one or more 'articles'. the following php code, I can get them all: and I get the following result: I would like to remove the title in bold above the…
Antilope
  • 443
  • 2
  • 6
  • 17
1
vote
1 answer

Drupal 7 Is the a way to programmatically know the Fields in a Content Type?

In Drupal 7, i need to Programmatically create the nodes, by using: $node = new stdClass(); $node->type = "movie"; After, just this codes above, and lets assume i don't know what are the fields for it. How can i get to know the fields and that…
夏期劇場
  • 17,821
  • 44
  • 135
  • 217
1
vote
1 answer

Multiple field groups with empty fields

I'm trying to make this working [Title Field] [Link Field] [Add More values] // Will add a [Title Field] [Link Field] But for example the first [Title Field] is having the value: Foo. With a link to http://foogle.fo Then I click on [Add More…
Max Allan
  • 640
  • 5
  • 18
0
votes
1 answer

Questions about creating a custom field for drupal

I started learning drupal customization, and i'm trying to create a very simply custom field for drupal. I tried to follow several tutorial, but when i install the field (apparently without problem) it doesn't appear into the field list. But if i…
Ivan
  • 4,186
  • 5
  • 39
  • 72
0
votes
1 answer

Unable to increase image title field length in drupal?

I want the caption/title to be set > 300. However, I notice that even though the field is set to accept a maximum of 500. In the database the 'field_image_title' column is set to 128. Any thoughts? Thanks.
claire
  • 813
  • 11
  • 16
0
votes
2 answers

Combine 2 user profile fields to provide "Add More" to the whole field

I am trying to create a user profile field in drupal 7 that combines multiple fields and can have multiple values. For Example, the field is "Past Job Title" ,"From Year", "To Year" and the whole field ( having 3 sub fields ) can have multiple…