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

learn more… | top users | synonyms (1)

0
votes
3answers
49 views

How do I configure a view that gets a taxonomy on a node, and retrieves fields from the taxonomy?

I have a view, which only appears when you navigate to certain nodes. Each node which it appears under, has a taxonomy with a field called 'related_content_entity' referencing some related content. ...
1
vote
0answers
13 views

Why does node_add_body_field() lock down 'body' field instances to the 'node' entity type?

For a current project our taxonomy terms need a text field with a summary; naturally as there's already a body field available on nodes, I thought I'd just use that. Confusingly, 'body' doesn't ...
0
votes
2answers
15 views

Change the value of a field depending on the selection of another

I need to change the value of a field based on the selection of another. I also don't want the user to have the ability to change this value. I tried using #disabled = true, but the values don't ...
0
votes
1answer
12 views

How to add an image property to an entity?

I have a requirement to add a unique icon to each bundle of an entity. My entity code is very similar to the model module. I have 2 entities, one for holding the actual entity instances, another for ...
0
votes
0answers
8 views

How to change integer field suffix base on value of other field

I have a content type property which has price as integer field and contract type as radio with options "Rent and Sale". I would like to change the price suffix depending on contract type option ...
0
votes
0answers
6 views

How to display taxonomy term reference field as a rendered entity?

I have taxonomy term reference field which are displayed as checkbox. Each taxonomy term has two fields 1. description and other 2. price I want the description and price field to be displayed ...
1
vote
0answers
11 views

Content Type no showing fields

I have been trying to created a content type programmatically in Drupal 7. I notice that I should use the hook_node_info to generate the content type with the title and to add the body I should use ...
0
votes
0answers
10 views

Scald module getting the field exception on reinstall

I'm having problems re-installing the Scald module, I have tried to properly uninstall it first and even removed some of the left over field related Scald tables manually. Here is the error I get ...
1
vote
1answer
15 views

How to put description on top of the input box, for a new field added to comment form?

I have added a new field to my comment form and this is how my comment form look liks: So you can see it does not look nice, I want to have the description on top of the input box, where I say: ...
1
vote
0answers
18 views

Rename or move field data from a custom field to the 'body' field?

Once upon a time, when I was young and not very bright, I created a content type for a site. In my ultimate wisdom, I deleted the default body field saying "I'll never need this!" and created a new ...
0
votes
0answers
8 views

Looking how to update field before node saves

I am looking to update a field with another field before saving or when the node is updated. I want to update a field array's (field_location_test) longitude and latitude values to a field that has ...
0
votes
0answers
8 views

Create Group fields with wrapper- D 7

I am newbie into Drupal. I am using Drupal-7. I wanted to create fields group with wrapper. Somewhat like View Block. But, don't want to use View-Block. So, is there any way to create group for ...
0
votes
1answer
9 views

how to show ubercart fields in manage fields section of content type

I'm needing to access the price, sku, etc fields in the manage fields section in structure/contenttypes. None of these fields show up in the manage fields section? I can manage their display under ...
0
votes
0answers
11 views

Generating fields programmatically for a page

I currently have two content types, one content type has a field which is a list of nodes of the other content type. I am using entity reference modules for this. I have a custom module that pulls in ...
-1
votes
0answers
17 views

How to sort comments on 2 different fields? [duplicate]

The following is the sort_comments. module file: <?php /* drupal@ganovelli.it - blackice78 */ define('SORT_COMMENTS_OLDER_FIRST', 1); // default ...
-1
votes
1answer
20 views

Easiest way to add color to a title field? [on hold]

I have 2 fields, one is an image and the other is just a title. Now the title hovers above the image, but the problem here is that the image might clash with the font color. If the image is ...
1
vote
1answer
28 views

unlimited number of values gets really big

I have created a content type with a field inside which can take unlimited number of values. eg a city with the names of its inhabitants. The problem is that this number can get really big (i.e. ...
0
votes
3answers
36 views

How to retrieve node body from nid with an SQL query in Drupal 7?

From this question I learned that I have to look in field_data_body to retrieve the body of a node from a database. field_data_body does not have an nid field though. What query can I use to ...
0
votes
1answer
17 views

Drupal commerce: product field based in calculation of other fields

The commerce product has the field: Price Then I added two more field: Quantity and Price per Unit I need the field Price per Unit to take the calculated value from this: Price per Unit = ...
0
votes
0answers
9 views

when Node Date Field is empty adding node returns 'The website encountered an unexpected error. Please try again later.' message

I have a field on a Node.content.type which is a date field. recently we've noticed if you enter a blank date here I get the error - 'The website encountered an unexpected error. Please try again ...
0
votes
1answer
23 views

Drag & drop upload plugin, how to make it multiple

I am trying to use this module to upload multiple files into a schemma that I created (in a separated module), https://www.drupal.org/project/dragndrop_upload $form['file'] = array ( '#type' => ...
1
vote
1answer
45 views

Jquery breaks on ajax run

I am using field collection & availaibility calendar module, I added a field collection in a content type as a field with unlimited option in field edit. now i have added a availability calendar ...
0
votes
0answers
12 views

Get content type field value without entity

I have a exposed form and want to use my field "field_region" for the breadcrumbs. If a user now selects the exposed "field_region", my URL looks like "?q=news&field_region=2". Now I want to get ...
0
votes
1answer
14 views

Receive error when printing field

Hi i've just started building a site on Drupal 7.31 and i'm following my normal procedure i've used loads of times. One of the things I have on most sites is an introduction just beneath the title. I ...
0
votes
1answer
46 views

Undefined index: und

I have created a custom profile field called "field_protection". I am using the following code to reference that field but am getting error: Notice: Undefined index: und $is_protected = 0; ...
0
votes
0answers
17 views

Drupal How to add extra field into rows in custom view block?

Here is dpm of my custom block rows. I want hook or alter another link dynamically through template. <ul class="list-inline"> <li class="plain-inline"> <a ...
0
votes
0answers
9 views

Single slideshow on node from combined fields?

So I have a node type that has two multi-value fields (one for images with ColorBox and one for 3D models using JSC3D) and I simply would like to show a single slideshow on my Node page that cycles ...
0
votes
1answer
12 views

Any way to add more than one text entry to select fields

In a form that a site user (i.e. not an administrator) fills out I want to have a section like this (the "[ ]" represents a checkbox in the form): Certifications [ ] Type 1 Certification [ ] Type 2 ...
0
votes
2answers
35 views

Outputting multiple content fields all wrapped in a div [duplicate]

I'm trying to wrap multiple field items in an HTML container. So let's say I have "Blog" content type. I have field1, field2, field3, field4 and field5 for this content type. I want to output ...
-1
votes
0answers
31 views

$node->sticky Always 0

Not sure what's going on and everything looks okay. In node.pages.inc while editing a node, $node->sticky always returns 0 regardless if the node has a value of 1. Going further back into the ...
0
votes
0answers
11 views

Meta-refresh based on Link Field

I have a custom content type that contains a Link field. I want to add a Meta refresh to every page of that content type that will redirect to the contents of the link field after a fixed number of ...
0
votes
0answers
8 views

make math operations with Commerce price fields? (the correct way)

I usually use a rule action "Multiply unit price by a quantity" You just put the values and options and rules makes all that stuff for you. But this time I have to do it in a custom module ...
2
votes
1answer
30 views

Alter html output of a term reference form field

On my node edit form a term reference field is rendered with the following html output: <div class="form-item form-type-radio form-item-field-trainingstype-und"> <input type="radio" ...
0
votes
1answer
26 views

How to modify field_suffix after form submit?

I have a form with a custom suffix (#field_suffix) for a field. I need to change the suffix value after the form has been submitted. Which hook should I use to achieve this ? Sample Code : ...
0
votes
0answers
16 views

Incomplete Date using Date Module?

I've created View/List that contains First Name, Last Name and Birth Dates. It's sorted by Last Name and then by Birth Date. Sometimes I only know the Year and not Month and Day but Date Module forces ...
0
votes
0answers
17 views

How to programmatically change region for field instance?

I have content type with more then one regions. When I open admin page "Manage fields" I can see which fields are in which regions. Is it possible to change programatically, in which region some field ...
1
vote
1answer
19 views

Drupal link field that accepts a URL or a Node reference

I am looking for a field just like Link, but that allows the user enter a URL or via an autocomplete a node/entity reference. This is because this field might be an external link or an internal link ...
0
votes
1answer
19 views

Problems with file type field of node

I have created some custom page on frontend for particular type of node modyfications. Here's my page callback: function vintranet_talk_edit_entry_page_callback($sNid) { ...
0
votes
1answer
9 views

After drupal 6> 7 upgrade attached pdf links not visible

After upgrade fromn 6 > 7 attachment information is not visible in nodes. Data exists in dbase. What is best approach to re-connecting pdf, mp3 and other attachments to specific nodes. (2000 or so) ...
0
votes
0answers
15 views

How to set a value on a field collection using entity metadata wrapper

I'm trying to programmatically set a value on a field collection item attached to the user entity. The field collection field in question is titled, "field_user_location". I initially had this ...
0
votes
1answer
11 views

Set the value of a hidden field in form block

Using the code below in a block, I am displaying a form in a block on all pages for a content type called Goals. I want to use this block / form to update progress on the goal to a content type called ...
0
votes
2answers
48 views

Add cropping option to an image form

I've the next form. $form['imagen'] = array( '#title' => t('Image'), '#type' => 'managed_file', '#upload_validators' => array('file_validate_extensions' => ...
0
votes
0answers
15 views

Error uploading file. An unrecoverable error occurred

I've been troubleshooting a form in Drupal 7 that has two file upload fields. If you upload a file with one field, then the other, the second upload will usually give an error. This occurs regardless ...
0
votes
0answers
8 views

How to programatically add undeletable fields to entity?

I'm creating pretty complicated system with few custom entities. Those entities will have some calculated properties, and some exposed properties - those calculated ones will be based on. I resigned ...
0
votes
0answers
6 views

registration form disable required username

I'm using the logintoboggan module, so that users identify with email and password. Everything works fine, with exception of that on the registration form is required to put a user name. It must ...
0
votes
0answers
2 views

Not able to put content abouve Image in article

I would like to put information about the author above the image in an article. But I do not want to use the standard Drupal Author informations. So I would like to use just a html textfield. I ...
0
votes
1answer
39 views

How to add drupal contributed modules into a custom module

I've done a custom module to generate some forms. There is a image field present. I would like to add cropping functionality in image field. I've seen that is very interesting the Imagefield Crop ...
0
votes
1answer
12 views

How to restrict completion of only one field within a field group

Is there a simple way to have several fields within a field group; such a way that only one field in the group can be populated. Example use Case Field group is called 'Insert Media'. The group ...
1
vote
1answer
24 views

How to know the “name” of an input field of a commerce checkout form?

I need to find the name of an input field of a commerce checkout form to use in: form_set_error('NAME-HERE', t('Field cannot be left blank')); The html of the field is: <div ...
1
vote
1answer
110 views

What properties does a custom cck_phone form field need to work?

I am struggling to get a working custom implementation of a cck_phone field from the cck_phone module. I have included my partially working code at the bottom. What seems to be not working is that ...