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

learn more… | top users | synonyms (1)

0
votes
1answer
14 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
12 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
26 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 ...
2
votes
1answer
14 views

How to pass multiple target_id/values field using entity reference prepopulate?

I read the documentation and saw that this is possible: node/add/page?field_bar=1,2,3 But how do you code this? I wanted to pass multiple target id, not just one. I tried this code but this only ...
0
votes
1answer
22 views

Custom validation rules for content entity fields

So I want to store an entity_type in a string field in my content entity. Since the list of entities can change over time, I can't use a list_string field with allowed options. I don't know if ...
0
votes
1answer
14 views

What is the difference between base tables and data tables for content entities?

Recently, Views was updated to use data tables (the data_table annotation on @ContentEntityType) by default. See the change record at https://www.drupal.org/node/2433153. This caught me out since I ...
1
vote
1answer
13 views

Create a view with user selected fields

I need to create a view with user selected fields. My basic requirement is data export. My site contains around 1500 nodes and each node has around 25 fields. I have a view for data export with 5 ...
1
vote
1answer
20 views

Which module can hide or show text?

I have a site with puzzle and I need to hide or show some answer. It can be some photo or some text. It can't be block, I need a module that will be able to hide or show fields as is it done in the ...
0
votes
1answer
24 views

Allow users to >only< upload images to existing nodes?

I want to allow users to upload images for exsits content, for example for article, but i will not allow they to delete already exist images. How modules i can use? How to create this submit form for ...
1
vote
2answers
15 views

How can I strip out default markup for a text field?

I have created text fields for first name and last name (which i need as separate fields so i can sort by last name when needed) but the default markup is so cumbersome! they each are nested in 3 ...
1
vote
1answer
14 views

Recommended module or method for a generic map/media embed field?

I'm aware of lots of modules for embedding media (especially https://www.drupal.org/project/emfield) and for embedding or generating Google Maps, but what I'd like is one general purpose field in ...
0
votes
0answers
22 views

Short code is not working with rendering the field in node template [closed]

I am using shortcode module and create custom shortcode. When I individual rendering the field collection field on the template, its not working, but If I rendering the body field like this print ...
1
vote
0answers
9 views

'Manage display': new fields not draggable

When I try to drag'n'drop a field under 'Manage display' / inside a view mode (e.g. "Teaser") it just doesn't stay above the Hidden fold. First the confirmation message is shown. But as soon as that ...
1
vote
1answer
16 views

Best Practices? Create dynamic links with static titles on node full view page

As with anything drupal, there are a million different ways to do something. I am asking this question for 1) Because I actually have to do something similar and 2) Because I would like to know all ...
2
votes
1answer
8 views

Printing raw field value to use in path to files

I have field called "field_cat_id" which has a numerical value (10201; 10202 etc). The field represents a category id and it is also used to arrange PDF files, I would like to print this (raw) value ...
0
votes
0answers
11 views

Drupal 7 - Rule sending email with field collection

I've defined a content type that contains a field collection. The field collection contains 4 fields. When the content is created, it may have one or more of the field collections. I set up a rule ...
0
votes
1answer
13 views

Combining fields and avoiding duplicate display

I use below code for printing out images in search results. I get double print outs on the ALT tags. If I disable ALT tags all displays just fine. <a href="<?php print $url; ?>" ...
1
vote
0answers
9 views

Field Option Set For Nodes Similar To Commerce Product Option Module?

First of all I am not using commerce module, I DID used it but it did not meet my needs regarding multiple carts and a lot more, so I cannot use commerce product option module. but the function of ...
1
vote
1answer
11 views

file as field node block

I am building a site in which authenticated users may upload files. When such a user is viewing URLs of a certain content type, I would like the left sidebar to contain, among other things, a file ...
1
vote
1answer
17 views

how to make an existing listbox autocomplete

I have made a content type which has a list box field. now I need to change its widget to autocomplete but as you know list box fields does not have autocomplete widget. now I have added 650 contents ...
0
votes
0answers
21 views

Cannot add fields to user entity

I'm getting an odd error that I've never encounter before. I'm trying to add a field to a user entity and upon adding a new (or existing) field, I don't get redirected to field options – instead I get ...
5
votes
2answers
109 views

Render a field contained inside of another field

I am using Drupal Paragraphs module that lets you create "bundles" of fields inside other fields. (It does this using entities). Each bundle has it's own tpl.php file. In addition, you can nest ...
0
votes
2answers
28 views

attach an programmatically generated pdf file to a node

Im using PDF Using MPDF module to generate 4 files when a node is saved using its API function pdf_using_mpdf_api: function MYMODULE_node_insert($node){ // PDF generation : // ...
1
vote
1answer
32 views

Solr index fields not showing a field

I have a field within a field collection that I need indexed. It's not showing up in the /admin/config/search/search_api/index/solr_node_index/fields page. I tried using this to try to add it myself, ...
0
votes
0answers
20 views

Drupal Custom Widget not saving form field value

I am trying to add a Custom Element to the Webform Content Type and save it in the Webform(table) column (group_id) Here is the Webform Custom Field which list all the groups as tree and does not ...
0
votes
0answers
16 views

Drupal rendering Custom Element children

Here is the complete code of element info function MyModule_element_info() { $types['my_element'] = array( '#input' => TRUE, '#process' => array('module_element_process'), ...
0
votes
1answer
15 views

How to add a class to a List field based on the content?

I have a List Field for the Articles that will work like a Category. This is an image of the PSD file: There are 6 options on the list so the user can select the appropriate one when creating the ...
0
votes
1answer
23 views

Replace field label in content type template [duplicate]

I'm outputting fields in a template for my content type like so: print render($content['group_details']['field_city']); However, I would like to replace the default label that is attached to the ...
1
vote
1answer
36 views

Drupal 7 field collection tpl no output on render

I'm using Drupal 7 with field collection module. I have my tpls setup and being triggered using the render function; however, even though the tpls are being executed, the output is being thrown away. ...
0
votes
1answer
33 views

Can I make Text Field accept filtered_html?

I have a content type where a field is the common name for a USA president. In examing a legacy database I'm importing some presidents have (simple) HTML in their name. For example Dwight Eisenhower ...
0
votes
2answers
39 views

How to hide field if blank

I have a view created which has a column 'Price'. I also I have another column 'Special Price' in the same view, but 'exclude from display' is selected. In views, click the price field > rewrite ...
0
votes
2answers
23 views

Productivity tool to help me add multiple fields at once

Is there any Drupal productivity tool that will help me create multiple fields at the same time? I'm taking about about the actual creation of the fields under ...
0
votes
2answers
21 views

Newbie: Using css to style fields in a content type

I created a content type using html elements as fields and groups. The content type configuration page allows me to add classes (and id attributes) to the elements; however, they don't show up in the ...
0
votes
1answer
29 views

Correct way to render fields from Entities?

This very popular article explains correct way to render fields: http://www.computerminds.co.uk/articles/rendering-drupal-7-fields-right-way According to the article, the correct way to render fields ...
0
votes
1answer
16 views

Is there any example for real project where field of deciamal type been used?

Drupal has several types of numeric fields: integer float decimal I know, that decimal field is used to store numeric data with high accuracy. But when it may be necessary in real project? Please ...
0
votes
0answers
14 views

Ubercart get order id from custom field value

I have created a custom field for using Drupal Field module. I want to get order if from the value of that custom field id. group_number_oc is the name of the custom field which stores 2,4 etc ...
0
votes
0answers
16 views

how to add custom field in agreement page?

when user is logged we will show agreement.In that i want to add custom field in agreement page.?that custom field #type is signature field. i used like dis? $items['test'] = array( 'title' ...
0
votes
1answer
22 views

How to keep all leading spaces in a text field (Drupal)

I need to allow users to insert leading spaces in their text. It appears that the default text field chopps off all leading spaces. I tried ckeditor and BUEeditor but they appear also to remove ...
0
votes
0answers
13 views

Get field formatter setting value from preprocess

I have added to media>video files a taxonomy term reference "video_quality", i.e. 480, 720... I use those files in a content type "video-article" and render the file with Video.js module. This module ...
0
votes
0answers
6 views

Providing an entity's bundle with a custom field

My module provides its own entity. I need my entity to have a structured date field with repeating dates. The modules date and date_repeat are suitable for this. I created an example of this field ...
1
vote
1answer
20 views

How does one add a new base field to a content entity?

I'm currently porting my contributed module to Drupal 8, and sometimes I realize I've chosen the wrong field type. I also know that I will need to add additional fields later on, and it would be nice ...
0
votes
1answer
43 views

Node.tpl.php file: Check is several fields are empty

On my node, I have three location fields (primary, secondary, code) and three object fields (food, fuel, accommodation). I want my node.tp.php to check if all the location fields are empty or if all ...
0
votes
0answers
2 views

call field from Taxonomy in Content View

I have a content view with term reference. I want to show an image field of these terms inside the content view. I tried to use this <?php print render($content['field_prof']); ?> inside views ...
0
votes
0answers
15 views

Location Module fields are not available under Search api fields

I am using Search API's Default Node index. I am using Location module to store Location data. But location module fields are not available under Search API Related fields. I know this has been an ...
0
votes
0answers
24 views

biblio author initials two character

I have Drupal 7 with biblio 7.x-1.0-rc7 module. How can I set up the biblio module that the initial of an author to be more then one character. I know it is a strange request, but e.g. in Hungarian ...
0
votes
0answers
23 views

YouTube media filed without remove media button

I'm using Drupal 7. The Remove media button on youTube media entry (field) is missing. This is for a field with name: Videos, field type: Multimedia asset (deprecated), widget: Media file selector. ...
1
vote
1answer
45 views

How can I add a CSS class to a View Field programmatically?

Using template_preprocess_field doesn't work, I assume, because this is a field from a View, not a node. I've looked at this answer however that only seems to apply to the field value not the markup ...
1
vote
1answer
33 views

How to allow integer and decimal fields with default values to be saved as empty.

If I set a default value on a decimal or integer field, the user cannot delete the default value and save the node. They can set the value to another value including zero, and that is saved ...
0
votes
2answers
14 views

Disable profile field when module that created it is disabled?

I have created a module that adds a field to the user profile. When I disable the module, I want the field to no longer be shown on the user profile. I do not want to wipe it out completely, since I ...
0
votes
1answer
20 views

Hide Price by Role for a Content Type in Drupal 7

I am trying to achieve the following: 1> Hide Price Field for a Role only on a specific content type. I am using Drupal Commerce. Things I tried: 1> Field Permissions for the commerce_price field on ...