Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Version tags should be used only for questions that apply to a version only, not to merely say what version a site is using.

0
votes
0answers
5 views

Core Media Library: Custom selection view (D8.6)

I'm trying to create a custom Media Library, to apply to only a specific media field. Basically I want a custom selection on media (with relationship and possibly contextual filter): I duplicated ...
-2
votes
0answers
12 views

Enable Bootstrap Modals jQuery UI Bridge

I am using a Boostrap subtheme with sass. I am having the issue with my custom subtheme of Bootstrap. My custom module creates a modal window, its not displaying content like buttons. The modal title ...
2
votes
1answer
103 views

How to remove unwanted form state values before validation

What is the good way of validating a form in Drupal 8 ? I have a bunch of fields which are supposed to be filled by a positive numeric value (and that's all, no other input types, just positive int). ...
1
vote
1answer
33 views

Add captcha to webform

I'm working on a drupal 8 project, I've created a webform and trying to associate a captcha to my webform using captcha contrib module. I've a personalized template for my webform in which I render ...
0
votes
0answers
28 views

Print individual user registration form fields in twig template

I'm creating a twig template which overrides the layout for a user registration form. How can I print the form fields individually? I've tried {{ form.email }} and {{ content.email }} to print ...
0
votes
0answers
12 views

key_value duplication errors after migration of the website

I have migrated my website from a server to another server. The only difference is that it went from a physical machine server into a containerized application. The server specs are the same and the ...
1
vote
1answer
79 views

Limit amount of adding a certain Paragraph per Content type

I use Drupal 8 Paragraphs module. I created a Content type Landingpage. I create some Paragraph types like Hero Image, Intro text etc. In the Content type Landingpage I created a Paragraph Entity ...
0
votes
0answers
26 views

Node body to entity reference revision (paragraph) field not working/processing

I want to migrate the Drupal 7 body of my blog to a Drupal 8 paragraph (field_stories_content which is Entity reference revisions). The body is to be assign to the field_stories_text_formatted field. ...
1
vote
1answer
37 views

Customize “Access Denied” (403) page for specific content type [on hold]

I'm currently setting up a simple LMS in Drupal 8 and would like to customize the Access Denied page as follows: Anonymous users should be redirected to the Login page, when they hit a 403 error. ...
0
votes
0answers
22 views

Is there an existing way to add sidenotes/comments inside the content of a node? [on hold]

Is there a way to put inline sidenotes/comments inside a node? A good example is the notes that you can add in Google Docs. That would be great for editorial purposes. Mentors would have a simple ...
0
votes
0answers
37 views

Pass PHP variables from my custom block to my custom Twig template [duplicate]

I created a custom block module my_block. Inside modules/custom/my_block/src/Plugin/Block/MyBlock.php I have this code: <?php namespace Drupal\my_block\Plugin\Block; use Drupal\Core\Block\...
1
vote
2answers
52 views

Processing the content generated by a node?

What call would I use to modify a node's content. For example, let's say I have the words "12345678" located in various nodes. If I wanted to replace all occurences of this in Drupal 7 with "abcdefgh",...
0
votes
1answer
19 views

Display single field from argument taxonomy term in Views header area

I have a view with a taxonomy term ID in the URL which is used to filter the displayed entities in the view. I want to display the description from the taxonomy term. I've tried this a million ...
0
votes
0answers
10 views

Issue using ‘explode’ and ‘migration_lookup’ plugins together

I’m new to migration, using migrate plus and migrate csv, I have some trouble mixing the ‘explode’ and ‘migration_lookup’ plugins. What I want is to add several media images to some media slideshow (...
0
votes
1answer
24 views

How to specify AND, OR with dynamic query

I’m trying to create a dynamic query, the query logic conditions needed are: AND, and OR. The main query will include two sub queries. The ConditionInterface::condition documentation states that: ...
1
vote
1answer
27 views

How to use short codes with arguments

I came across this. That shows how you can get a code like {{ cta }} populated with any data you want, and get that inserted in a template. I want the same sort of solution, but for content. In other ...
0
votes
1answer
28 views

Why does the shopping cart display the login form?

When I'm not logged in and click on the cart logo, the following page appears with the login form: /cart 1) I want the contents of the shopping cart to be displayed. 2) When I click on the "...
1
vote
2answers
28 views

How to send the emails related to the user account in HTML?

I want to send the emails related to the user account in HTML version: forgotten password new account account canceled ... If I make a copied paste of my HTML code, it does not work. /admin/config/...
2
votes
1answer
37 views

Different page--user.html.twig for different user roles

I have a few user roles - simple user, editor and contributor. How to make different profile pages for all of this roles? Now I can work with: FILE NAME SUGGESTIONS: * page--user--16.html.twig ...
-1
votes
0answers
20 views

How do I declare a new template file for my theme? [on hold]

I recently built my first site with Drupal 8, off of the public beta. One thing I found very quickly was that online learning resources for Drupal 8—as compared to Drupal 7—were essentially non-...
0
votes
0answers
11 views

How to get slideshow for a node fields display, having multiple images and multiple videos?

I have a content type having image field and video field,where multiple images and multiple videos can be uploaded. In a node page display,i want to show all images and videos in a slide show. I tried ...
0
votes
0answers
14 views

Exclude in result search node Content Type and Language

I'm use this module Search Exclude I want exclude content type and filter to by languague. Search Exclude (Node) I use this module because is practice, simple and easy compared others module of the ...
0
votes
0answers
23 views

Why does changing date portion of a datetime string on node presave subtract an hour from the time portion?

I have two date fields, one only accepts date input and the other is only accepting time input (via the technique where you set the ['#date_date_element'] = 'none' as described in this answer). In ...
0
votes
0answers
29 views

How to send custom user field to page--user.twig

I created a custom user field - field_editor How to display value of this field in page--user.html.twig? Thank you for help.
0
votes
1answer
21 views

Pass argument to view for pager limit

It is possible to pass and argument to a view for the limit on its pager? I see that there is this question for Drupal 7, but not Drupal 8.
0
votes
1answer
16 views

How to alter the owner/authored by field to the current user when using quick_node_clone

Using Drupal 8 with quick_node_clone module. When a node is cloned I need to change the 'owner' or 'authored by' value to the person who is cloning the node. There is an opportunity of manually ...
-2
votes
0answers
19 views

What is /offline page?

I have migrated my Drupal 7 site to Drupal 8. Today after 15 days of migration I just noticed in my Google Analytics account that I have received 799 page views to /offline page since I have launched ...
0
votes
0answers
12 views

How to add Filter by File extension in media Browser?

How do I add a filter by File extension in media Browser (not in file browser)? This filter lists all extension files existing in media.
0
votes
0answers
23 views

Add for loop values and result into custom block and twig file

I have a custom block. In modules/custom/my_block/src/Plugin/Block/MyBlock.php I have some PHP code and this for loop: // Get number of current day. $day = date('j'); // Get number of current month....
0
votes
1answer
28 views

How to disable redirection to the node after node form submission

I have a node form exposed in the front-end to allow visitors to add their organisation to the list of partners. Below the form, I have exposed view block with the list of existing partners. When a ...
0
votes
1answer
14 views

How to add a percent field in content type

Simple question. When creating a content type field, we have a float, decimal and integer number type, but how can we create a field with percentage type value, basically a range of 1-100%.
0
votes
1answer
18 views

hook_form_form_id_alter doesn't save data by default

I use hook_form_form_id_alter() to edit the user_form. I'm creating some checkboxes and textfields. Thats working fine. I also can output the values, when clicking the submit button. But it doesn't ...
-1
votes
0answers
8 views

How to load a value in product attribute using \Drupal::entityManager();?

I am having product attribute called "plan type" inside that I have "basic" and "premium" values. How can I get the value if i know the id.
0
votes
2answers
30 views

Validation with hook_form_alter()

In Drupal 8, for the Comment entity, I want to validate an integer field (stored as field_nieuwe_waarde_value). In each comment posted for a node, it needs to be greater than the value for the ...
1
vote
1answer
29 views

How to add template suggestion for user--VIEW-MODE--ROLE.html.twig

I used hook_theme_suggestions_HOOK_alter: function MYTHEME_theme_suggestions_user_alter(&$suggestions, $vars, $hook) { // Define the view mode. $mode = $vars['elements']['#view_mode']; // ...
3
votes
1answer
39 views

Temporarily change the current language during a request

Background information I am developing a multilingual Drupal 8 commerce site where only authenticated users (customers) can place orders (anonymous users can't place orders). Customers can edit their ...
0
votes
1answer
36 views

How to display custom user_field in user.twig

I created a custom user field -field_interes and I want to print this field in user.twig. Anybody can help me with this problem? {{ content.field_interes }} does not work. Thank you!
1
vote
1answer
12 views

Theme Preprocess Conditional Field Display

Looking for a way to preprocess two fields. I am trying to hide Field 1 from display if Field 2 has value. If Field 1 has value and Field 2 has value display Field 2 only. If Field 1 has value and ...
0
votes
3answers
31 views

Modify a custom block field value with hook_form_alter and validate

I'm trying to modify a custom block form with hook_form_alter .In its validate function I have a case where one of the field value needs to be unset. For modifying its value I tried with $form_state-...
3
votes
1answer
74 views

Is it normal that Drupal enters maintenance mode during a module update?

I have created a custom module with an .install file, which includes some hook_update_N() and hook_update_N(&$sandbox) update hooks. These are used to update a collection of existing nodes. ...
4
votes
0answers
33 views

Is it a security issue to put CSRF token in drupal settings?

I have an application where I created a REST resource to update a field on the user object to store bookmarked items. When you do a post request to a rest resource you are required to use a header ...
0
votes
0answers
8 views

Use multivalue field collection on a webform

I want to build a field collection and give the opportunity to the user to add more than one field collection. The field collection is named Office and it contains the fields Desk, Chairs and ...
0
votes
1answer
15 views

How to load a webform via ajax inside custom JS?

I'm trying to load a webform block via ajax. Right now I have: $.ajax({ url: '/form/contact-us', success: function (response) { console.log(response); }, error: function (...
0
votes
0answers
14 views

React/GraphQL - Issues fetching user relationship data

I'm using GatsbyJS, gatsby-source-plugin and Drupal 8. Using http://localhost:8000/___graphql playground, I'm able to successfully query my drupal data. Query : { allUserUser { edges { ...
1
vote
2answers
30 views

How to get user.field value in node.twig

I have a field_author with different values expert, moderator or contributor For get this custom USER field in node.twig i using next function function MYTHEME_preprocess_node(&$variables) { if ...
0
votes
1answer
17 views

Module dependent on field configuration in another module

I have two modules that rely on the same field; A simple boolean field that represents a state for taxonomy terms. My problem is my configuration management for this. My ideal situation would be to ...
-2
votes
0answers
21 views

How to validate a webform at server side [on hold]

In my Drupal8 website I have a webform and I have developed a custom submit handler to submit the data to an external API, I can't use the remote post handler because I have to check the data before ...
0
votes
0answers
27 views

Entity reference view display is not displaying fields as expected

I have a number of registered users on my drupal 8 website who some of them are "active" and the others are "blocked". I want to add a select list field inside the article content type displaying ...
0
votes
0answers
9 views

Log in with HTTP POST from external site, then redirect to Drupal page, but access to the page is denied

I came upon a little problem during work today. I'm developing an angular frontend for a Drupal backend and want to redirect certain users from the angular site to the Drupal site. I log in as ...
1
vote
2answers
49 views

Add new column “Block description” on block layout page

I need to add a new column called Block Short Description on Block layout under /admin/structure/block. Can anyone let me know how to achieve it? I have Attached screenshot for reference.