0
votes
0answers
4 views

How do I create a field template or template override for a specific display mode?

Because in the Drupal 7 Commerce module, the fields, 'sku,' 'title,' and 'status' aren't editable by Display Suite field wrappers, I'm unable to edit the field wrapper via the Drupal front end, I need ...
0
votes
0answers
5 views

How to hit an endpoint (menu route) with the session intact

I'm trying to hit an endpoint which shows different data when logged in/out. I am trying to write a unit test, but can't seem to figure out how to hit the end point with user context. How can I do ...
0
votes
0answers
2 views

Can tokens be used to set values of other fields and in modules which use tokens?

I am finding the Metatag module rather unwieldy, and I want to create fields in the content type from which Metatag values will be set. Are there tokens available for the fields of any arbitrary ...
0
votes
1answer
5 views

How to add a view of product fields to a product display so that it changes when add-to-cart form is updated via ajax?

In Drupal 7/Commerce, I would like to display a view of product fields attached to a product so that when the add-to-cart selection is updated and product fields are updated via ajax, the view is also ...
0
votes
1answer
7 views

Module Library JS Some In Header Some In Footer

I have read that Drupal 8 by default loads library-defined files into the footer. My module libraries.yml file makes use of the "header: true" property as several JS files are needed to load in the ...
1
vote
0answers
14 views

What is the correct way to get the value of a field? [duplicate]

We have several fields on the Article content type such as field_headline (plain text field). When we try to access the value of this field in a module hook such as mymodule_preprocess_page (mymodule....
0
votes
0answers
4 views

Views Grouped by *each* value of a content field (multivalue).

I am pretty new to drupal, so some terms I describe may not be accurate. Anyways, I know how to group things in views using single values (i.e. Group faculty members by their departments: engineering, ...
0
votes
3answers
17 views

How come I cannot fetch the name of the taxonomy term from term id?

We are doing the following query below to fetch all the taxonomy term values in the term_category vocabulary term. When we do the following query below, we get NULL value returned. Content Type: ...
0
votes
0answers
8 views

Create a field with options are a combination of taxonomy terms, and content types linked to those taxonomy terms, for which the content type is used

This is a decoupled drupal 8 back end with an angular front end connected over jsonapi and other custom restful inputs. We have a coupon content type in out Drupal csm. It is exactly what it sounds ...
0
votes
0answers
10 views

Display output and style output are the same

Trying to theme a view and it defaults to the page.tpl.php and not to my new template. The new template is in bold in the advanced theming section of the view and in the proper folder in the theme ...
-1
votes
1answer
12 views

Post form min max value

I have a custom form with min and max price value: $form['price']['min'] = [ '#type' => 'hidden', '#default_value' => isset($_GET['price']['min']) ? $_GET['price']['min'...
0
votes
0answers
21 views

How do I use an older jQuery version?

Drupal 8.5 requires jQuery 3, which has some site breaking features. I would rather like to use version 2.2.4. I have tried the libraries-override approach suggested in How do I use a jQuery version ...
-1
votes
0answers
20 views

How do I write a custom module to leverage the Nodeaccess module?

After doing some research, I have figured out that I can use the NodeAccess module to control some key permissions. Specifically, I need to grant access to a specific user (that is also referenced via ...
0
votes
0answers
9 views

Howto check if a form contains custom type field in hook_webform_submission_form_alter?

How to check if my custom element is added to form in hook_webform_submission_form_alter. Below is the screenshot what i am getting in form array. Custom composite element can be nested under 3 or 4 ...
0
votes
0answers
6 views

Why do some bootstrap classes disapear when i translate some elements?

I noticed that when using drupal in english with bootstrap theme, some buttons have a btn-success class which give them a green styling <div class="form-actions form-wrapper form-group" id="edit-...
-1
votes
1answer
20 views

Field collection does not show on the page

I've installed filed collection on drupal 8 version. Now I'm trying to add field collection named "field_ingredients_second" to a content type. And then I've added fields to this newly created field ...
0
votes
0answers
16 views

Render node in page manager variant

In D7 we could render a node in a particular "page manager" variant by the following module_load_include('inc', 'page_manager', 'plugins/tasks/node_view'); return page_manager_node_view_page($node); ...
0
votes
1answer
10 views

Migration Source YML File import date string into date and time field of content type

I have a json file full of data exported from a wordpress site, one field being a string representing a date and time: "03/15/2012 14:46:19". I would like to import that string into a date and time ...
1
vote
1answer
12 views

How to reorganise files location without updating each node manually?

In my file system, I have different folders where are stored the files linked to the nodes (either pictures in the body of the node or pictures in a 'Gallery' field I added to custom content type). ...
0
votes
0answers
6 views

Getting problem in drupal form validation having ajax fields and other fields

In Drupal 8.5.6, I have a form with one ajax dependent dropdown field and two more other normal text fields. But when i give validation to form, when text field validation fails ajax fields gets reset....
0
votes
0answers
7 views

Switch panel page dependent on viewport

Using Drupal v7.5x panel pages with Bootstrap v7.x-3.20 theming, I would like to switch available page panels layouts based on the viewport found by the end user. For example, a minimal set of (ie 2 ...
-1
votes
0answers
14 views

How to show content based on the value of some user account field?

I have some field in my user account (gold and silver) and I want to show content if for example, my article has the same field (so gold or silver). How do I do that ? Note: I thought about adding a ...
0
votes
0answers
10 views

Get custom taxonomy fields [duplicate]

I am trying to get a custom field assigned to taxonomy. I have tried this: $vid = 'zeme'; $terms = \Drupal::service('entity_type.manager')->getStorage("taxonomy_term")->loadTree($vid); $...
0
votes
0answers
12 views

Graphql views integration queries

I create a simple Graphql view with query name: "mostPopularGraphql" and then try to execute in explorer(graphql/explorer) query { mostPopularGraphql { results { entityLabel } } } I got this error: ...
0
votes
0answers
18 views

Why does the same form/field appear diffently depending on the browser? [on hold]

I have a custom content entity created with Drupal Console and the corresponding CRUD forms. In this entity there is a field defined this way: $fields['startdate'] = BaseFieldDefinition::create('...
2
votes
2answers
137 views

How to change the value of the publishing status checkbox to false by default?

I want that checkbox to be unchecked by default, because currently it's always checked. And I want this result: The structure of my content is as follows:
0
votes
0answers
17 views

Update the block through ajax

I have added a block which shows the no of items added to an entity. I want to refresh the block through ajax as the items are added to an entity through ajax form so whenever I add an item, it will ...
0
votes
0answers
17 views

How to make default user registration form to multi step?

I want the multi-step sign-up form for my drupal7 website. So I have 2 approaches are here. https://www.drupal.org/forum/support/module-development-and-code-questions/2010-12-15/altering-user-...
0
votes
1answer
34 views

How do I load CSS files to a custom theme?

I understand this question has been asked many times. However, I still can't figure out why the CSS files of my custom Drupal 8 theme are not loading. Edited (more info): The CSS files are not being ...
0
votes
2answers
27 views

Add download attribute to file type

how can I add the "download" attribute to a file in my content type? I'm using this: https://api.drupal.org/api/drupal/core%21themes%21classy%21templates%21field%21file-link.html.twig/8.2.x I get ...
0
votes
2answers
16 views

Theme filter for a view

How can I theme filters for a view in drupal 8? I would like to place the filters to the sidebar menu, and rather than having standard either dropdown or autocomplete field, I would like to have ...
0
votes
1answer
13 views

Commerce Product listing View with category contextual filter, How to show items of (selected term and its child terms)

I have a the view 'Browse Products by Category' with the path: /taxonomy/term/% and a contextual filter: Product: Category (field_category) and let's say I have these categories: Sensors --- ...
0
votes
0answers
24 views

How to set relation name in insert()?

I'm trying to do an insert query on a external PostgreSQL database with Drupal 8 : $db->insert('site') ->fields([ 'civility' => 'mr', 'firstname' => 'firstname', 'lastname' =...
0
votes
2answers
21 views

How do I programmatically load an order by its properties?

I know how to load an order by its ID using \Drupal\commerce_order\Entity\Order::load($order_id). I added a custom field (Token ID) to the orders. How can I load the orders knowing the value of that ...
1
vote
1answer
10 views

How do I add reCaptcha to a form? [on hold]

I have a custom form on my site, and I want to attach a reCaptcha to it. I wasn't successful using the Drupal 7 code for this. Suggestions?
0
votes
3answers
30 views

Is the current form an entityform form?

I am using entityform module on some forms, but in a custom module, I need to check if the actual form is an entityform or not. Depending on the current form is actually generated by entityform, I ...
0
votes
0answers
16 views

Changing the sitename when sharing on facebook?

I have a product site, in which i can share products on facebook. But my the host is xx-koebogsalg-54.com or something like that. Is it possible to change the name? Or at least move it? or is the ...
1
vote
1answer
101 views

on('load') is not working with jQuery 3?

I used to use the following function to load a video in the background (jquery 2.2.4): function getVideo() { if ( $('video').length ) { $('video').each(function() { if (...
0
votes
0answers
20 views

No breadcrumb on front page

I've a Drupal 8 (8.5.4) site which is using a custom created on top of Bootstrap Barrio. I'm using Easy Breadcrumbs module. Here is the configuration I used. Easy Breadcrumb settings The default ...
1
vote
1answer
14 views

How to retrieve value of start date with format end date?

I D8 installed the module Optional End Date in order to add an optional end date within a date field. When I had a single date field value I could get the value by using: $datum_deelname = $node-&...
0
votes
0answers
8 views

Removing an item from a field collection when a new item is added; re-adding it when an item is removed

In Drupal 7, I have a field collection with a list of values. After adding another item, the previous item should not appear in the field collection. Similarly, after removing an item, the previous ...
1
vote
1answer
29 views

For a customer database table, do I have other options, beside creating a custom module?

I'm upgrading my site to Drupal 8. Currently, I have a custom module with a custom database table and I query that to provide historical data that is in the table. The data is really purely tabular ...
0
votes
1answer
47 views

Why is it so abstract? [on hold]

Please forgive me for asking an open ended question. Are there various resources that explain WHY different changes were made? I'm getting used to the idea of YAML and TWIG files. I'm just ...
0
votes
0answers
21 views

Interface Microsoft Access to Drupal database

I am wondering if anyone has ever succeeded in editing their Drupal database with Microsoft Access. I have already figured out how to use Oracle's Mysql ODBC connector to enable MS Access to see my ...
0
votes
0answers
12 views

Manage Display Field Label not changing: inline does not work

I have the same problem as question 212176 and discovered it has to do with CSS. I have 2 (local) sites both with module ds enabled. I configured in both a field where I want the label and the value ...
0
votes
1answer
20 views

User Created Slideshow

I am new to Drupal and I'm looking for a slideshow of user uploaded images on a user uploaded project. Basically, I want the user uploaded images to be shown on the content page, in addition to text, ...
0
votes
0answers
21 views

How would i Add form fields dynamically via drupal ajax like the example below?

I've tried to use the addmore form from the examples form but im a little confused with adding the additional fields and having the fields appear in a row on the next line?? // Gather the number ...
0
votes
0answers
27 views

Block caching prevents the javascript from always being loaded

I have added a custom block and added javascript along with that, But javascript is not working when i enable the cache and on removing the cache, the content doesn't get updated. I have added the js ...
0
votes
1answer
29 views

Trying to use variable to pass a view argument/parameter

I'm currently in the middle of trying to figure out a way to pass the value from a variable to be used as parameter/argument for my drupal view. I have a contextual filter that currently configured ...
0
votes
0answers
17 views

Eliminate duplicate entries for a single node with multi-value fields

Here is a view for a single node. It currently shows multiple entries, one for each of the multi-valued fields. I just want a single entry. I have checked both the Distinct boxes in the settings for ...

15 30 50 per page