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

How to Expose Filter to user when using View for EntityReference field Drupal

I have an entityreference field on node creation that allows you to select another node. I’d like to be able to let the user filter by content/node type, instead of seeing them all at once. (The nodes being selected are organic groups/group types,…
UnsettlingTrend
  • 414
  • 1
  • 5
  • 19
0
votes
1 answer

Define and use a field of other node type as my form element type in Drupal 7

I'm developing a Drupal 7's module. I defined a node type named 'Booth'. Now in my module, I created a form with some fields like name, phone, address and so on. One of these fields is Booth which is a Select type element. I wanna have the booths…
0
votes
1 answer

Drupal Views - Custom Theme for a field

Two quick questions regarding custom theming of view fields in Drupal 6 - (a) I know that we can include a custom theme for a view field in a appropriately named template file but I notice that it has to be placed in the theme folder. However, I…
0
votes
1 answer

drupal theming a view for Customfield: PHP code

I have a view called "contests_slider" with a block display. I'm hiding all fields and using a "Customfield: PHP code" field instead which calls a function called display_front_contests(). In that function, querying the database and building some…
EricP
  • 1,459
  • 6
  • 33
  • 54
0
votes
1 answer

Drupal 7: Populate node fields with values from $form

I would like to know if it's possible to populate a node fields with the values from form_state or something like that. Basically what I do is to show a register form merged with a form from a Content Type. I do that by using field_attach_form().…
mihai
  • 43
  • 8
0
votes
1 answer

How to dynamically remove field in Drupal 7 custom form using AJAX

Based on the "Add-more button (with graceful degradation)" example available in Drupal examples module I have created a form that can add fields dynamically using AJAX, and now i want to add a separate Remove button to each of those fields so that i…
PIKP
  • 691
  • 2
  • 13
  • 19
0
votes
0 answers

In Drupal after selecting a value in an autocomplet, I need to load field values from a database record

I am using Drupal 7's Form API to develop a prototype for an old system. I've managed to get the dropdown select boxes to load dynamically and dependently from the database. I have also managed to connect an autocomplete to the same database. …
0
votes
1 answer

drupal - collection field with status - publish checkbox

is there a way to have a publish checkbox on a collection field associated to a content type ? if i have 3 items on a collection field associated to a node , one i want to set it unpublished so only 2 are displayed. cars content type: …
0
votes
1 answer

Drupal 7 - how can I control content layout in a view?

I've been handed a design spec which requires a news listing in a specific format - e.g. image floating to the left, with the main title and content on its right. I've created the articles listing using the views module and embedded the view as a…
Ambulare
  • 877
  • 3
  • 10
  • 31
0
votes
2 answers

Drupal 7: make values of a field dependant on other field value

I created a content type with different kinds of fields (text, dates, entity relation...). I have 2 dropdown fields (related to 2 taxonomies). I would like that the second dropdown values change based on the value of the first dropdown. I found the…
webpaul
  • 146
  • 2
  • 18
0
votes
1 answer

Hiding Time Field if Date is Expired

My time field shows after an expired date. My client wants to have the time hidden after the expired date. But still have the date show. Is this possible?
fitnessCraze
  • 37
  • 1
  • 10
0
votes
2 answers

Add field when adding new content in Drupal

I'd like to ask a tricky question to you about Drupal. I created a new content type which includes lots of fields. I want to find a module that adds a 'Add another' link to the adding content screen which will duplicate certain fields. Example: I…
0
votes
1 answer

Drupal fields: Passing a variable to view

I have a custom field plugin. It's widget looks somewhat like this: function mymodule_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) { ... $main_widget = $element + array( '#test'…
navij
  • 11
  • 4
0
votes
1 answer

How to limit selection to one across several term reference fields?

I'm hoping somebody can help me. I have added nine term reference fields, one for each of my vocabularies, to the Create New User page. What I want is to only allow one term to be selected from all nine term reference fields. I realise that one way…
0
votes
1 answer

Drupal: Auto fill CCK field

I have a "movie" content type, on the node for a movie I have a link to create "Movie Review" content. I was wondering if it is possible to pull the title of the "Movie" Node and put it in the Title field of the "Movie Review" creation page when the…
UpsetPopcorn
  • 87
  • 3
  • 9