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
0
votes
1 answer

Creating a link field in a custom content type

I have several custom content types and in one specific one I need to offer two fields, one for the href for a link, and one for the text of a link this way I can build and style it with minimal user involvement of the HTML/CSS. I also have a custom…
HomeBrew
  • 841
  • 2
  • 12
  • 24
0
votes
2 answers

Drupal 7: View theming - Get specific field by it's number?

I'm trying to get a specific field number in my "views-view-fields--news.tpl.php". Right now it's like this : $field): ?> content; ?> I've tried to do something like this…
Danny Coulombe
  • 2,339
  • 1
  • 17
  • 23
0
votes
1 answer

Access file URI in Views tpl

I have an image field and I would like to access the URI directly via PHP in views-view-fields.tpl.php I tried: echo $fields['field_foto']->raw; but it seems to show just the nid and I want the uri of the picture...
joerg P
  • 63
  • 1
  • 1
  • 5
0
votes
1 answer

apply rel="nofollow" to field in drupal 7

I have content type with name "Product" and there is field name Remote product link and field type is link. I want to set rel="nofollow" for this field. I am new to drupal and I am stuck here. Can anyone please help me on this? Thanks in advance.
shahzad shah
  • 109
  • 7
0
votes
1 answer

Drupal, copy values from a content to another content

I've created two content types with CCK: is a recipe with a multigroup field for ingredients; is a shopping list. the users can create many shopping lists. I would like to have a dropdown menu with all the user's shopping lists and an "add to…
Segolas
  • 545
  • 2
  • 8
  • 26
0
votes
1 answer

Drupal 6 - How to add 2 strings in CCK Computed field?

I have a CCK Text field called: field_fb_field_b I have a Computed field called: field_fb_link_computed In my computed field I have 2 variables called: $var1 ="some text"; $var2 ="some more text"; I wanted my Computed fields to add something…
sticky2010
  • 11
  • 1
  • 3
0
votes
2 answers

Cannot get array element by key, but key exists on array

I'm working with Drupal 8, but since this looks like a PHP problem to me, I'm asking it here and not on Drupal Answers. The isset statement in the following code should return TRUE, but it does not: /* $specifier =…
Orlando
  • 379
  • 5
  • 16
0
votes
2 answers

How to display and hide Drupal 7 fields, based on value of a specific field

What I am trying to do here is controlling how a group of fields are showing up on node view. I don't want to control them by user role, as this is going to be a node level permission and I don't want these permissions affect other nodes with the…
Mehr
  • 61
  • 1
  • 2
  • 3
0
votes
1 answer

Drupal form design without using associative arrays

How to design Drupal forms without coding a lot?
0
votes
1 answer

Drupal 8 - How to enable custom field under manage form display programmatically?

I have created a drupal8 module that programmatically created custom user fields. It display in Manage fields section but not enable/view inside Manage form display and Manage display section. I have tried to override entiry_form_display but not get…
Durgesh
  • 87
  • 2
  • 8
0
votes
1 answer

How to create an entity reference field which will allow unlimited values in a configuration form?

public function buildForm(array $form, FormStateInterface $form_state) { $form = parent::buildForm($form, $form_state); $config = $this->config('category_dynamic_block.settings'); $form['section_title'] = array( …
0
votes
1 answer

Drupal 8 - Admin - Content Types - Manage form display - Fields groups, labels, headers

I would like to know if possible in ADMIN, without modifying the admin template, by means of some module or extension do the following: I would need to be able to create the data entry form for content types by putting headers, separation lines…
0
votes
0 answers

Where is the "Enable/Disable translation" value stored in the database?

Where is the "Enable/Disable translation" value stored in the database? I haven't been able to find this info anywhere.
0
votes
1 answer

Drupal Add Field Collection with mutli-value field with web services

i am trying to create a node that have a field collection with multi-values, but this only save the first value and the second not. I am trying in the following way: "field_mobile_number_collection" : { "und" : [ …
0
votes
1 answer

Drupal 7 | Preserve file after entity_wrapper unset?

Question is quite simple: How to preserve file on server and in file tables, so its fid is still valid after unsetting/changing value with entity wrapper? $ewrapper = entity_metadata_wrapper('node',…