Tagged Questions

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

learn more… | top users | synonyms (1)

1
vote
0answers
7 views

Drupal 7 - how to add custom field token to webform default value?

I want to add node-field data into the web from block via tokes as with Webform 7.x-4.1 this should work. But tokens from custom fields are not available in a webform(block) ? [node:title] and ...
-1
votes
0answers
6 views

nested field ccollection on node makes form editing bad experience in terms of performance

I have 3 nested field collections in a node,performance is too bad for form editing, i want to improve node form performance ..please help me with some solutions
0
votes
0answers
22 views

How to hide empty column during csv export in a view?

I want to hide the empty column from csv file which is generated using view data export module. I have try change in "No results behavior" options but still empty column header display in csv files. ...
0
votes
1answer
33 views

How to theme form elements in a custom field widget?

I'm creating a custom telephone field and I'm a bit confused at how to go about theming the widget. I have four elements in my implementation of hook_field_widget_form()... A dropdown for the ...
0
votes
1answer
14 views

File in field_file disappears after saving a node

Like I wrote in the title. After I upload the file it is being saved in my folder correctly, but after I save the node, it just doesn't remember I have uploaded it. The file stays in the folder I ...
0
votes
1answer
15 views

Accessing text of a field with type “Text”

I fear that my question could be covered in detail already somewhere, but I did not find something useful. So appologies if this is the case. I added a field of type "Text" to content type "Article". ...
1
vote
1answer
37 views

can we add new column to a view programmatically?

I want to add new field in a existing view programmatically. I am trying to use hook_views_pre_render(). function registration_export_views_pre_render(&$view) { if ...
0
votes
0answers
8 views

AJAX Form Not Inserting Default Values Based on Variables

I'm creating a content creation form for a custom node type that will be updated with AJAX. The basic idea is that this is for processing media mentions, and the AJAX will call a function that will ...
0
votes
3answers
54 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. ...
2
votes
0answers
16 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
18 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
10 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
7 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
13 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
11 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
19 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
14 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
9 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? [closed]

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
18 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
30 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
50 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
13 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
48 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
19 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
13 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
38 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
13 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
32 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
17 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
17 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
14 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' => ...