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
2
votes
2 answers

Drupal 7 conditional fields : How to display specific fields based on other select option fields

I am using Drupal 7 and conditional fields. I need to show a select field with values based on the value selected from the first option field. For example, if the first selected option is "Country" and I select "Country" to be India => I want to…
user1679530
  • 21
  • 1
  • 2
2
votes
1 answer

How to correct altered key|label pairs in "select list" fields (and corresponding data) after migrating to Drupal 7?

I am most of the way through migrating a Drupal 5 site through Drupal 6 to Drupal 7. The CCK Content Migrate did a great job with one exception: all fields in "select list" format have one of several issues with the key|label pairs in their "allowed…
ktana95
  • 21
  • 3
1
vote
1 answer

List of fields for a content type in Drupal 7

What im trying to do is get a list of all main fields content type has created (core fields and cck fields). Similar to what is described here: How to list CCK fields by content type in Drupal but for Drupal 7. Help anyone?
AlekzZz
  • 11
  • 1
1
vote
1 answer

In Drupal, is it not possible to have fields associated to entities that do not have bundles?

I have created an entity via custom module. This entity does not have any bundle and it gets created perfectly fine. entity_get_info says it is not necessary to have bundles. Next, I create a field for entity reference using field_create_field and…
Mukesh Agarwal
  • 204
  • 1
  • 2
  • 7
1
vote
2 answers

Grouping fields together

In Drupal, is it possible to make use of multiple fields for a single option? For example, if a dropdown menu with a label of "What time do you wake up?" lets the user select a day of the week (Mon-Sun), beside it would be an empty textfield where…
enchance
  • 29,075
  • 35
  • 87
  • 127
1
vote
2 answers

Reading node field values in drupal7 programmatically

I am looking for the best way to get a field value from a node id. My actually code works however I guess there is an easier way. $node = node_load( 1 ); $lang = $node->language; $field = 'body'; $value = ''; if ( isset($node->{$field}[$lang]) &&…
jantimon
  • 36,840
  • 23
  • 122
  • 185
1
vote
1 answer

drupal : content type CCK - add an existing field disappeared?

I recently installed a drupal from scratch and I'm installing additional modules according to my needs. The biggest problem I have is that if I go in admin/content/node-type/NODETYPENAME/fields (the page where I can edit/add/delete the CCK fields)…
PartySoft
  • 2,749
  • 7
  • 39
  • 55
1
vote
1 answer

Drupal Video module add fields to each video

How can we add fields to each video in the Video module? I need to add a title and description to each video. I see there is a Description field for the thumbnail, maybe I can add a title to that? It looks like It may need to be added to…
EricP
  • 1,459
  • 6
  • 33
  • 55
1
vote
4 answers

Add a field from a node into page.tpl.php, drupal 7

Creating a sub-theme in Drupal 7's page.tpl.php and needing to pull the value (plain text) from field_EXAMPLE from a custom content type outside of where the rest of the content would normal be.
BVSK
  • 133
  • 2
  • 12
1
vote
1 answer

Drupal: - Field Info API as REST

We would like to get label for the field. As per previous question: How do I get a field label by the field name? But I need to get this through the REST API of Drupal. Could anyone please suggest what should be the approach to use the Field API…
Banng
  • 531
  • 1
  • 6
  • 19
1
vote
2 answers

Search 2 fields in a Drupal content type

I need a simple search form on my Drupal site but I can't figure out the best way to get it done. Basically I have a content type with a couple of different fields and I want my form to search in both the title and the body and then return a list…
schwift
  • 329
  • 3
  • 19
1
vote
1 answer

Creating sub-nodes in Drupal from a single node form

I would like to have a special "sub-node" that could be attached to other Drupal nodes, that allows authors to include commentary (from the author, so this isn't a comment node) and sample text, to the parent node. I plan to use the exact same…
Biagio Arobba
  • 1,075
  • 11
  • 27
1
vote
1 answer

Undefined index: custom field in locale_field_entity_form_submit() (line 438 of locale module)

Hi I am getting this kind of error in creating custom node type with custom fields: Undefined index: field_block_pre_login_body in locale_field_entity_form_submit() (line 438 of D:\xampp\htdocs\projects\foo\modules\locale\locale.module). Custom…
Cedric
  • 1,236
  • 2
  • 18
  • 35
1
vote
1 answer

Drupal CC/Views - new fields not showing up in CCK

I am working with CCK/Views for the first time, and I am stuck on a detail... I have created a custom type called Outlet (as in Retail Outlet). I added 5 new fields to my new custom type. I created some content in my new Content Type. Then I went…
harry_T
  • 285
  • 2
  • 3
  • 11
1
vote
1 answer

How can i add list(image) field in drupal 7?

I'm using Drupal 7 + Ubercart. Have to add a field with easy selecting from images (52 logo images of producers), that are already uploaded and will be used every time, when i'm adding new product.
bigg_jack
  • 35
  • 1
  • 8