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

learn more… | top users | synonyms (1)

1
vote
0answers
20 views

Add new field to content type programmatically

I created a content type in Drupal programmatically with the following code: function reservation_system_node_info() { $items['add_item'] = array( 'name' => t('Add a new item'), 'type' ...
1
vote
1answer
34 views

How to set up a field to provide a publish/unpublish feature?

For layout reasons, I need a field providing a publish/unpublish feature. We already have something very close with the Publish Content module. Still, it looks like there's no option for setting it ...
1
vote
2answers
81 views

Differences between 'Add existing field' and 'Add new field'

It is possible to reuse the already created fields via Add existing field option. From optimization perspective and the way Drupal stores and manages such fields in database I would like to know, does ...
1
vote
1answer
27 views

Content Field Type For Video, Images and Text

I'm trying to decide what the best method would be for creating a new Content Type who's field type would allow me the flexibility to use ANY type of content inside of it. Almost like a blank HTML ...
0
votes
0answers
13 views

How to create a custom field that gets URL counts from LinkedIn on external articles?

My site has a content type named News, which receives news from external RSS feed. Therefore, content type News has the following fields: Title = article title (i.e. Hapag-Lloyd orders five ...
0
votes
1answer
17 views

Content type itself as entity

I need to classify and mark my content types. As example I have three content types for group messages in OG, ten content types which used as UC products, etc. So I need to add taxonomy and fields to ...
0
votes
1answer
6 views

Two field multiple values

Not sure if this is the correct terminology to explain my question, but I have a client on Drupal 7. My client organization is related to another organization that possibly has a Drupal 8 site. There ...
0
votes
0answers
9 views

Arrays of integers in Views Datasource JSON output

I'd like to output my pages content as JSON file. I've creates a module using Field API, for a custom variable containing RGB values in three fields. When processing the content of the page I'd like ...
0
votes
0answers
12 views

Video Embed Field module - how do I add attribute 'id' to the embed youtube iframe?

The question is related to DRUPAL modules name is 'Video Embed Field' module. The default output of this module generated the Youtube iframe embed as set in the config by Administrator. But... The ...
0
votes
1answer
13 views

Field names returned in search snippet. How to hide?

Field names are being returned in the search snippets on my search results page, like so: Academic Culture Body Text: The academic culture of your host country may be quite different from ...
0
votes
0answers
21 views

Multiple Fields Custom Form not saving default values?

I tried to create multiple fields with values on it using custom form which allow users to add data as many as possible. and then I can populate from there, but I tested submit and the default value ...
0
votes
1answer
13 views

Different suffix for multiple field value

I have multiple field value -3 value-, each value have a defferent suffix. For exemple there is a field vessel consumption with 3 value, each value have a unit of measure: HFO or MGO, MDO. Is there a ...
1
vote
0answers
31 views

Filter views slideshow of fields by nth newest node

I've seen variations of this question posed over the years but am yet to find a solution that works for my situation. I have a view slideshow block of fields that rotates through all the field ...
0
votes
1answer
19 views

Print field with an array [closed]

I have a field name called 'field_serial_571' that contains an array. I've tried several ways to display it and it only display blank space. I ran a debugging script (printr) and this is what I found: ...
0
votes
2answers
24 views

How can I print a text field's database value with devel so that it displays on all nodes?

I want just the text field's data without an of the "field-" divs wrapped around it. It's a link so I want to do something like <a href="foo.com"><?php print ...
0
votes
0answers
6 views

Creating a thumbnail navigation other than original image for slideshow gallery

I want to create a thumbnail navigation other than original image for slideshow gallery namely I upload image and upload related image thumbnail separate.
0
votes
0answers
18 views

field autocomplete with the same value of another field

i have a problem and i don't know if drupal has support for it. for example I have "field one" and "field two" and i want that when in content type an user select a value in "field one", "field two" ...
0
votes
1answer
17 views

How do I get the database value of a text field with $content?

I need to output a raw link from within a text field, without all the "field-" divs, in node.tpl. I've tried <?php print render($content['field_download_link']['LANGUAGE_NONE']['0']['value']); ...
0
votes
0answers
17 views

How to add text with summary field in drupal?

I am using drupal form API to create my form and want to create a text with summary field but when I use the type text_with_summary, nothing shows up in the form. For now, I have used two separate ...
0
votes
0answers
12 views

is there a module for instagram like YouTube Field?

I need a module that permit to my editor user to choice photo from instagram and linked them in a field of a content type. I have found https://www.drupal.org/project/instagram_feeds but I don't ...
0
votes
1answer
21 views

Accessing Drupal array values [closed]

I'm noobing my way through countless websites trying to find an answer to accessing a value in a Commerce field array. I somehow managed to throw together the following code to retrieve a value for a ...
0
votes
1answer
24 views

Add Clear Button to Comment Field?

Use Case: User wants to clear his comments to rewrite it. When the User is populating the Comment field, I would like to offer a Clear or Cancel button that will remove the content.
4
votes
2answers
62 views

Restricting View access for Drupal Commerce Line Item field based on Role

I have a Order page which displays set of line items: However, my client wants me to remove the "Responsible Vendor" from display for Authenticated users but it should be displayed for Admins / ...
0
votes
1answer
21 views

Auto Increment value for field collection

I have a field collection group to which I am importing values using Field Collection Feeds Importer. This requires a unique identifier field within the field collection. This has posed an issue where ...
0
votes
2answers
52 views

How to add a checkbox to a Content Type and act if box is set to true or yes

Module name, 'text_grabber' Content Type, 'node' name 'essay' **When I enable this module, I want a checkbox to be added to the ~/node/add/essay page. So when an user adds a new essay to the site ...
0
votes
1answer
26 views

Load all field collections of a given type

Currently I am using a query to load field collections of a specified type, but I wonder if there is a more drupaly way to do it? $query = db_select('field_collection_item', 'fci') ...
0
votes
0answers
8 views

How to insert an entityform in a custom form?

I'm building a multi-step form in Drupal and in one step I want to insert the fields of an entityform. What I've done is: module_load_include('inc', 'entityform', 'entityform.admin'); $entityform = ...
2
votes
2answers
9 views

How do I create a container entity that contains variable number of fields

I am interested in creating a content type that contains a variable number of fields. Each field contains an entity reference to another entity, but as I said there may be one field or 4 fields. I'm a ...
0
votes
2answers
38 views

Display different fields depending on field value in node template

I have a field named field_event_type. When creating a node, you can select one of two options for this field from a drop-down list: birthday party Wedding I want to be able to display different ...
0
votes
2answers
30 views

Print Link field in View template

I have a 'Link' field that is entered in plain text by user. I am trying to display the raw value of this field in my views template. I did dsm($fields); in the views template. For the field, the raw ...
0
votes
1answer
11 views

How do I hide a field from a Profile2 form without deleting it?

I have a field in a Profile2 form. I'm trying to streamline the signup process and not ask for users' phone numbers. However, I don't want to delete the phone numbers of users who have already ...
0
votes
1answer
17 views

Restrict access to the content for the own author depending upon the field value

This is what I want to achieve: If the value is not "Approved" the author can still edit or delete his/her own content. If my admin status values is "Approved" then the content can not be edited ...
0
votes
0answers
25 views

What is the use of module_invoke_all?

The documentation states the following. Invokes a hook in all enabled modules that implement it. All arguments are passed by value. Use drupal_alter() if you need to pass arguments by reference. ...
0
votes
1answer
17 views

Why are there two default image options in an image field

When you create a field of type image in Drupal 7, there are two default image fields. One is in settings and the other is in field settings. There is a message with each of those two settings, but I ...
0
votes
2answers
37 views

How to render field attribute in foreach

I have a link field with multiple values. I want to display the link title for each of these fields. I can print the slide link titles individually but not using the foreach. Currently I have: ...
1
vote
1answer
11 views

How do you get the display settings of a field on a particular content type/display

I'm looking to preprocess a field. The field type I'm wanting to preprocess is an entity reference field. I need to know what view mode has been selected on the display settings for this field (see ...
0
votes
0answers
10 views

Node Reference field does not select referenced node automatically

Drupal 7. I use Organic Groups (version 1.x, cannot upgrade to version 2.x) I have a container content type called Group. I have another content type ("Group Post") that allows them to post inside ...
0
votes
0answers
8 views

an alternative method for field_multiple_value_form

Is there a way to use an alternative method for field_multiple_value_form($field, $instance, $langcode, $items, &$form, &$form_state) I just want to avoid that draggable widget. Or maybe ...
2
votes
2answers
38 views

Print just field data from a view into a block?

I'm trying to get a variable from a view to display on a block. For example "We have 200 blog posts" (200 being the variable). Right now I'm using the views_embed_view method. The problem is the view ...
1
vote
1answer
30 views

image field point to another image field

I have users whom are part of a group, this group has an image field that can be changed by the administrator. When a user writes a new article, i wan the article to display the image of the group. ...
1
vote
2answers
54 views

How to use views replacement patterns while using the PHP filter?

In views, when using the standard text formatter you can place replacement tokens such as [title] into the HTML code either in a rewrite or in this case global text for Drupal to render. In this ...
0
votes
1answer
24 views

Adding an Image field in webform module

I am a newbie to drupal 7 and just started working with it a couple of months ago. My problem is I am making a "webform" where the user filling the form should upload his image. But as there is no ...
0
votes
1answer
27 views

How to create fields group as accordions?

Hello Drupal community, I am trying to create a group of fields with an accordion, so that it can be visible/unvisible with a simple clic on the title of the field's group. Does anyone know how to ...
2
votes
1answer
14 views

Option sets for fields?

In my content type I have a products field (entity reference) which references other content types (product content types). What I want to do is each product field has to have a specific option set, ...
2
votes
1answer
10 views

Help with a custom field widget

I am trying to create a custom field widget to be used by the taxonomy term reference field. Basically I would like to select which taxonomy terms can be shown in the select list. So far I am able to ...
0
votes
0answers
8 views

How to rename system name field_name without deleting field, without losing data from db? [duplicate]

I have a field_trademark. 400 nodes have this field filled. I want to rename it to field_brand . How to do this without losing the data?
1
vote
1answer
20 views

How can I add a field to a view description

I'm running into a quite simple problem : I would add fields to a view description, in order to list my views by this field. Example : add a taxonomy field to the views, let's say "View color". Then, ...
0
votes
1answer
24 views

Drupal 7 views add one field as a URL to another

I am using Drupal 7. I have a view where i filer a certain content type say "A" and display the below 2 fields Content: Title Content: File attachments My File attachment formatter is set "Url ...
0
votes
1answer
19 views

Adding a new column to users table: db_drop_field errror

I'm trying to add a column to the 'users' table. When I install my module, the column gets created and when I uninstall it gets deleted. The issue is that after I uninstalled, I run a 'drush cc all' ...
2
votes
1answer
40 views

How to remove a value from URL parameter?

I'm using entity reference prepopulate and views. On the start of my node add form I'm using views to display some products and I have created a PHP button to pass the nid of those products to the ...