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

learn more… | top users | synonyms (2)

0
votes
0answers
6 views

how to load custom Field into a custom Module (form Controller)

if i have: <?php /** * @file * Contains \Drupal\arm_main\Plugin\Field\FieldType\myField. */ namespace Drupal\arm_main\Plugin\Field\FieldType; use Drupal\Core\Field\FieldItemBase; use Drupal\...
0
votes
0answers
6 views

how to apply twig template / theme in field formatter

i have field formatter like: class myNameDefaultFormatter extends FormatterBase { public function viewElements(FieldItemListInterface $items, $langcode) { $elements = []; foreach ($items as ...
1
vote
2answers
21 views

How to create a Content Type that reuses data from existing Content Type?

I have a specific use case that does not seem to be covered by existing Drupal modules. I need to be able to create a "content type" that is created by choosing from a list of existing content. ...
0
votes
1answer
24 views

How do I access the parameters fields of hook_mail_alter(&$message)?

I am using hook_mail_alter in drupal 8 to alter the email messages sent through contact form . How can I access $message['params'] fields in hook_mail_alter()? I am getting the following values with ...
0
votes
2answers
33 views

Output Custom Field in Drupal 8

How can I output a custom field in Drupal 8 (Bootstrap theme)? Editing the field.html.twig file, if I have a custom field named field_title I thought {{content.field_title}} Would display it, but ...
1
vote
1answer
30 views

How to include only an updated custom field in an email created using Rules?

I used the Rules module to create a rule with an event "After update existing content". This rule sends an email to the editing user when that user makes an edit to one of the multiple custom fields ...
1
vote
0answers
21 views

Get Multiple Field Values Out Separately In Twig

I have a content type called 'locations' with a bunch of plain text fields. Each field allows for multiple values. For example, one of the fields is named 'support' and allows for an unlimited amount ...
-1
votes
0answers
9 views

Some field slideshow transition effect not working [on hold]

I used a field display as a slide show, under that field I choose transition effect is scrollHorz. But it is not working for me.
0
votes
1answer
14 views

Different theme of Media module audio player in Firefox and IE and chrome

I installed Media module, and there is a content type for audio files. The Manage display of the audio field is Audio. But the player has different themes in different browsers. This is what Firefox ...
3
votes
3answers
49 views

How to generate URL alias without %20 in URL?

We have a custom field that is being used to generate the URL alias. One issue we have found is that when we set the page to "Autogenerate URL Alias" and set the URL pattern to "[node:...
0
votes
1answer
16 views

List publications by same Author on Staff page

I'm using the biblio module to manage publications on my site. I've a content of type "Staff" that display all workers. These workers have publications that are listed on the publication page (using ...
0
votes
1answer
16 views

Content Type Segmentation

I need to know if there is a way to create a content type and within the content type to create a field which this field should be segment. For Example : at the beginning i will have an image, this ...
0
votes
1answer
13 views

How do i get views field labels in the template file

I am creating a view, and displaying view by using custom template files. As per theme suggestions I named the template file for fields as views-view-fields--blog-display--page.tpl. In this file I ...
1
vote
1answer
30 views

how theme/template connected/related to each other

for example, I have: module id: module_id (file: module_id.info.yml) FieldType ID: FieldTypeID (file: /src/plugin/Field/FieldType/FieldType.php) FieldWidget: FieldDefaultWidget (file: /src/plugin/...
0
votes
2answers
11 views

Views conditional fileds: multiple values

I have a content type with the following field: List (float) - blue - green - yellow In the view, I want a condition that says that if the value is "blue" display this: div class="blue" If it is ...
2
votes
0answers
25 views

'Views Field' issue in NO RESULTS BEHAVIOR - Hide if empty not working [on hold]

'Hide if empty' configuration of views is not working properly as a result all the empty fields are showing. Is there any work around to force fully hide empty fields in the views result (Page/block) ...
0
votes
0answers
6 views

Views conditional fields: multiple values

I have a content type with the following field: List (float) - blue - green - yellow In the view, I want a condition that says that if the value is "blue" display this: div class="blue" If it is ...
0
votes
2answers
13 views

How to print entity referenced fields (node) title in node.tpl.php?

I want to print an entity referenced fields (node) title in node--customtype.tpl.php. <?php print render($content['field_my_entity_reference']); ?> prints the field with some CSS class as below:...
0
votes
0answers
17 views

Fetch a value of field from field settings form in hook_preprocess_field()

I am inserting the fields from hook_form_FORM_ID_alter() in field config edit form. Now I want to get this value of field in hook_preprocess_field(). How can I achieve this? function ...
0
votes
1answer
24 views

Count total number of values in a field of all nodes combined for a view

I need to count the number of entries made to a field in all nodes combined together. I tried toggling aggregation to 'yes' and aggregation type to 'COUNT as distinct'. But at that time I'm getting ...
0
votes
0answers
19 views

term reference custom autocomplete field only populated with first data item

All, We added a custom field to the user profile called "interests and skills", with type Term Reference, widget type Autocomplete term widget (tagging). The vocabulary assigned to that field exists ...
0
votes
1answer
11 views

How to set a specific date (fixed value) as default value on a date field?

I have a commerce order on which I have added a date field. The options for the default value are Now or Relative. How can I add a fixed default value, f.x. 20 Aug 2016?
0
votes
0answers
24 views

Drupal 8: Add fields from another form to a existing form in a widget

I am trying to build a module that provides a widget. The widget is based on FileWidget and I would like to add some fields from another form to the existing FileWidget form. I would like to save the ...
0
votes
0answers
13 views

Date field to save events [closed]

I need to save some events(Medical checkup, Insurance renewal, Tax filing etc) on a specific date in a node. Number of events will be different with each nodes. I had tried Multi-field module to ...
0
votes
0answers
7 views

Inconsistent font in Profile2

I am using a Profile2 module to create user profiles. I added several fields in for the profile and amongst them a field (called 'Type') of TERM REFERENCE type to get values from my custom Taxonomy. ...
0
votes
0answers
10 views

view fill field form

I don't know how to did that, then i tell you some advises. I want to create a view which allow an admin to search an user. The admin can apply some filter and sort the results by params like (...
0
votes
0answers
14 views

How can I make an entity reference to a translatable vocabulary show autocomplete results in the appropriate language

If I have an entity reference field on a node that uses a entity reference list view to create its list. How can I make it search and display results from the language currently being edited. (...
1
vote
0answers
12 views

Term Reference Autocomplete field that searches fields besides name

Is there any way to have a term reference autocomplete field search other fields than just the title? In my case I have a organizations vocabulary with the taxonomy name and an acronym. The main ...
0
votes
0answers
26 views

Change field widget type from textfield to select box

There is a text field city(field_city) for user account and it contains lots of data for users. Autocomplete feature is also implemented in this field. Now there a new requirement to change this text ...
1
vote
1answer
25 views

Where is the group of a fields group stored in datababase (to get it programatically)?

I have installed the Field group module, which, as the name implies, groups fields together. Once you have ordered the fields of content type, is there any way to programmatically get the group of the ...
0
votes
0answers
21 views

search node for taxonomy fields: performance considerations

On Drupal 8, I am using taxonomy membership in a breadcrumb builder: every node not explicitly on a menu will have to be checked for membership in a taxonomy. I haven't come up with a better way of ...
0
votes
1answer
41 views

How to change value a field of preproces

I am new to PHP and Drupal. I have content type with a type list text field "Infraestructura". The values and labels are these: agua | Agua de pozo incendios | sistema contra incendios electricidad |...
1
vote
0answers
9 views

Exported feature, panelizer fields are unknown when installing in another environment

I can't seem to find out why my panelizer default layout is not being installed correctly after being exported using features. I am exporting a content type, with some default panelizer settings. ...
0
votes
1answer
13 views

How do i add addmore button for fields in webforms

clicking on ADD the functionality is done in drupal-6 using webform and webform add more modules. I am trying this in Drupal-7 ,but unable to achieve above functionality. I am using webform modules ...
0
votes
2answers
52 views

Add new field to custom content entity type

I have created a custom content entity type called Course. When I installed my module, Drupal automatically created the table schema for my entity, so all the fields I defined in Course::...
1
vote
0answers
19 views

Error When Clicking - Add Another Item - An AJAX HTTP request terminated abnormally [closed]

On drupal 7, I have a problem with a form. Render content type form in drupal 7 everthing working fine but I created a Field Collection, when I click Add another item this error occurs /***********...
0
votes
2answers
16 views

Commerce Price Field formatting

I'm using a view which is rendering the Product displays as DisplaySuite modes. Right Now, the generated code for the price looks as follows. <div class="commerce-product-field commerce-product-...
1
vote
1answer
41 views

Is there a core method in views that can pad numbers with leading zeros? [closed]

Setup I am building a view that outputs human usable id's. These ids would look best if padded to 3 characters. For example the episodes of a tv show may look best if they are formated: 01-01 (...
1
vote
2answers
65 views

Add class to first field in fields views

How to add class to first fields in views? I think that I need to add one if but I dont know what argument to put in if... So how to add class just for first field in views-view-fields template. {% ...
0
votes
0answers
21 views

Custom Custom Fields

I am building a new Drupal 8 site and trying to create a custom field that contains other already built in Drupal default fields. Here's an image of the fields already baked into Drupal that I want to ...
0
votes
0answers
15 views

Show field after a user has clicked on javascript link and track these javascript clicks per entity

The problem is this: I would like to not show the email field directly when a user lands on an account page in my site. There are 2 basic reasons for that: Our marketer guy needs information ...
1
vote
0answers
6 views

How do I import editable copies of an existing “child-node” into a “parent-node”?

Here's what I need: I want to be able to import content of selected existing nodes (let's call them child-nodes) into a new node (let's call it parent-node), and I want to be able to edit the child-...
0
votes
0answers
7 views

Fixing a custom Entity Content Type - Links are going to Page Not Found

I'm coming into an existing Drupal 7 project and the previous dev created a custom entity type called Role Types which just has 1 textfield in it. I don't know why he did this when he could have just ...
0
votes
0answers
22 views

Help with fields and visualization of data

I need to develop a simple website with following requirements: - A form with fields in which employees will input data to. They should select the organization they are inputting the data for (...
0
votes
3answers
50 views

how to get field type from form_state

how do i get field type (e.g textfield, option, etc.) from form_state public function validateForm(array &$form, FormStateInterface $form_state) Cheers, AnD
0
votes
1answer
23 views

Body field data not showing in View or Edit mode but exists in database

This is very similar to this question, except there the asker answered with a solution that is not relevant. Scenario: made a copy of a D7 site in order to apply new theme. All content types etc seem ...
0
votes
1answer
38 views

How can I override default theme_fieldset() function?

I am trying to override the theme_fieldset function in a custom node edit form where the fieldset is added dynamically. Here is what my code looks like: function cms_content_edit(){ $node = ...
0
votes
0answers
12 views

Add Custom Fields to Apache Solr's Search Results

I am trying to modify the search results on our Drupal 7 site using Apache Solr search. Similar to this post. We have a custom field called "Page Display Title". I want to get the value from that ...
0
votes
1answer
33 views

Rendering field with the help of functions

I have a field and I can render its value in a such way: <?php print $entity1->field_list_of_options['und'][0]['safe_value'];?> But I have many different entities at the page so I want to ...
-1
votes
1answer
26 views

Drop down list add “other” [duplicate]

I have a content type with a field "Document type". It is a drop down list, something like this: Document type A Document type B Document type C These are the default values for the field. I want ...