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

Questions tagged [8]

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
1answer
34 views

Using http basic auth (pop-up) log in securely to private intranet site, avoiding listing in search results

Requirement I would like to implement a private, intranet-like Drupal 8 based site that is accessible via the internet but that does not show up in search engine results. I have already researched ...
0
votes
0answers
18 views

Menus, drush uli link, and some images not working after moving site to localhost

I've just gotten a site I'm supposed to do some work on but I'm having trouble with migrating to a local development environment. I don't have admin access to the site itself, but I do have access to ...
1
vote
1answer
60 views

How to get the correct 'base hook' to override a template file in a custom module?

How can I find the 'base hook' to override a template file using a custom module? 'node' and 'user' are pretty straightforward, but others can be a little more elusive. Example code... MYMODULE....
1
vote
1answer
28 views

How to use ConfirmFormBase to confirm the action of another form?

I have a form that allows users to upload a CSV file. Upon submit, I would like to show a confirmation form ("Are you sure you want to import this file?"). However, the Drupal 8 examples for ...
4
votes
1answer
71 views

Is it possible to make manual teaser breaks work with “Filtered HTML”?

This question is about Drupal 8. Placing the following line inside a story node's body (I guess it also works for other content types) adds a manual teaser break: <!--break--> In Drupal 7, to ...
-2
votes
0answers
15 views

Custom module tokens are not available in message templates created via message module

We have a custom module that adds some tokens which are available site wide, however these tokens are not available in message templates that are created via the message module. Is there a way to ...
-1
votes
0answers
27 views

How to programmatically create a top-level book page when creating a node?

In Drupal 8 with the Book module enabled, when I programmatically create a node of a certain type, I want to make it the top-level page of a new book. To do this when creating a node in the user ...
2
votes
0answers
24 views

Working with hook_node_access_grants

I am currently working with Permission by Term to set simple access control on two node types with terms. As noted here, I believe I found a bug where the access record isn't written the first time ...
2
votes
2answers
82 views

How to programmatically add custom markup to every displayed user name

Drupal 8.x I am currently using hook_preprocess_user(). I would like to alter the username to add some custom markup to every username. MYMODULE.module: function MYMODULE_preprocess_user(&$...
-1
votes
1answer
39 views

Your PHP version does not satisfy that requirement [on hold]

We use the following for our local development environment. When we run composer require 'drupal/module_name:^1.1', we get the following error message. We have doubled checked that all settings for ...
1
vote
2answers
68 views

How to customize the page /node/add?

On Drupal 8, there is a page on /node/add. I want to customize this page by replacing the links with buttons, but I have not found a template to do that. I have also enabled the debug mode, but there ...
0
votes
2answers
15 views

Change shown fields in a grouped view depending on group

I have a view that shows nodes and groups them by their taxonomy term. Is it possible to show less fields for a specific term? For example there are user profiles with names and pictures that are ...
1
vote
1answer
31 views

Automatically importing module-provided translations during installation

I have a custom module whose interface strings have all been written in English. This module is not (and will not be) hosted on drupal.org, so I'd like to pack the translations for those texts ...
0
votes
1answer
13 views

Exposed filter cleaner URL

I have created a custom content type called building which I have added a entity reference field called category which is the vocabulary and added building type terms. I created a view called ...
0
votes
1answer
17 views

Select list in entity reference in VIews

How to create an entity reference exposed filter in drupal 8 in Views? The only option i have is input of type text
0
votes
0answers
21 views

How can I run functional tests from a custom module to test one specific mult-site instance?

I have tried to do a simple test of a module located on a sub site (Drupal multisite), but when the test looks for the module to activate it, it can not be found, if I move the module from the sub ...
0
votes
0answers
9 views

How to keep the order of the displayed content ?

I have a view, which lists the content. On the view I am using a pager, so that only 10 contents are displayed per page. At the same time I have a sorting filter, which is changing the order of the ...
0
votes
0answers
22 views

How to know the type of store?

Drupal 8 and Drupal Commerce 2.10 I have several types of store on my site and I want to modify the button Add to cart of all the products associated with the store type online (online is the machine ...
3
votes
0answers
40 views

When a path is associated to more routes, which route is used?

How does Drupal 8 decide which route to use, if there are two routes defined in Drupal 8 via routing.yml that lead to the same path? Of course this sounds like a stupid idea or like a mistake in code ...
0
votes
0answers
13 views

How can I run behaviors inline in a node body text?

I realise its not recommended but for fun and experimentation i want to edit/run custom inline js wrapped in a drupal behaviour from CKEditor. Im using Drupal 8.6 and bootstrap theme, which loads ...
0
votes
0answers
15 views

Remove Home from menu at module installation

I can remove the "Home" tab from the main menu going to /admin/structure/menu/manage/main, but I would like to automate it so that it is done at module installation. I checked that the configuration ...
0
votes
0answers
25 views

Views Load More/Infinite Scroll Programmatically

I would like to render a Drupal 8 view programmatically. I know how to do it the Drupal way with Views::getView($view_name). The thing is I want different templating for the first 3 items of the 9 ...
0
votes
1answer
19 views

Custom Entity: define a view in entity reference field

I defined a custom entity and for a entity reference field I want to set the view reference widget and a view/ display to be used instead of an autocomplete. I tried many different settings - nothing ...
0
votes
1answer
18 views

How to add title of the image in manage display section or display it in node view page

I want to display title property of an image in node view page. How can I display title of an image along with image in node page?
0
votes
1answer
13 views

Drupal 8 Migrate Plus - CSV Row Number as key

In the Drupal 7 migrate module, you can use 'csvrownum' as the mapping key when migrating content from a CSV (https://www.drupal.org/node/1152158). For the Drupal 8 version, I am not sure what the ...
1
vote
1answer
108 views

How to display the status of the user?

I created a TWIG template for the "Teaser" view of the user account. I want to display a logo and change its color according to the status of the user : When the user is logged in <i class="user-...
0
votes
0answers
10 views

How to modify drupalSettings JavaScript in an Event?

I have a UserLogin event subscriber. I want this subscriber to output a variable from marketing tracking purposes to Javascript, however, I don't see how I could accomplish this, as the Event ...
0
votes
0answers
12 views

Programmatically determine if a site can send HTML emails [closed]

Is there a way to programmatically find out if a Drupal 8 can send emails in HTML format? The sites can have several third-party or custom modules that can enable such capability.
0
votes
1answer
37 views

Why is my update query OK for the database but the page shows the wrong value?

I have 2 custom content entities created with Drupal Console (drupal generate:entity:content): 'person' and 'member'. They are linked (1 member <-> n persons) by a field named 'member_id' in '...
0
votes
0answers
35 views

Set an image as an image style programatically

We are trying to import a 18,000 image from an antiquated Alfresco system into Drupal 8. The old system already created cropped versions of the original assets that need to be kept and used in news ...
0
votes
2answers
49 views

How to load and render a webform with Ajax

I'm new on Drupal 8, and I want to make a custom module to load any webform of (webform module) on other pages of the website. The idea is to load the webform when the page load. All webform has ...
1
vote
3answers
94 views

How to do a redirect in node.html.twig?

I'm trying to do a redirect on my node.html.twig template based on the content type because I'm using views for my content. I tried this: {% do redirect('/example') %} or this: {% redirect '/...
2
votes
2answers
36 views

Is it possible to update module provided configuration schema in an hook_update_N()?

So I have a custom module with a module.schema file, defining a configuration schema for that module, not talking about database/field schema. module.settings: type: config_object label: 'Settings ...
0
votes
2answers
33 views

How can I allow HTML links in translated strings?

I created a custom D8 module with all text strings declared in English, either via this->t(), t() or in various configuration (YML) files. I am now in the process of translating those strings in ...
0
votes
0answers
46 views

Workflow issue that has been completely baffling

One of my developers, who has been working with Drupal since he started several months ago, recently ran into an issue with the composer install command that failed with the following error: ...
0
votes
0answers
30 views

Multiple file upload issue in multipage webform

I have created multipage webform in my development drupal8 site and there is multiple file upload field in second page of multipage form.Totally form contains 3 pages.When i upload multiple files in ...
0
votes
0answers
18 views

Book navigation progress

As part of the requirement, for logged in user, Show list of books to the users and show progress bar for each book(like how many pages user has visited). Navigate the user to the unread page ...
0
votes
0answers
37 views

Allow Custom Form Field '#default_value' to be 0 in Elvis Operator

Dupal 8.x I have a custom form field where the value could be zero for radio elements: $yes_no_options = [ '1' => t('Yes'), '0' => t('No'), ]; $form['config_name'] = [ '#options' => $...
0
votes
0answers
17 views

How to get a single node field into custom form

I have a custom form in which referenced field needs to be displayed. Here is the structure: Content-Type: Project Reference Field in Project Content-Type: POD Details(Fields- MemberName: User ...
1
vote
0answers
13 views

How to get first & last revisions?

I have Article content type. Moderation is enabled. So user will move article from Draft -> Published -> Draft -> Draft -> Published . So all revisions is going to create for each state. $...
0
votes
1answer
25 views

Creating nodes with cURL that have multiple tags and a content moderation transition

I've enabled the rest restui serialization hal and basic_auth modules and enabled and configured the Content resource like this: I'm able to create nodes with: X_CSRF_TOKEN=$(curl http://d8.local....
0
votes
0answers
13 views

Import taxonomy with hierarchy through JSON:API

I'm using JSON:API to migrate data from one Drupal 8 site to another and can successfully migrate taxonomy terms. However, the hierarchy is not preserved. My taxonomy migration looks like this: ...
1
vote
1answer
44 views

Dependency Injection if service exists

Is there any way to use dependency injection in a conditional way, i.e. only if a service exists similar to \Drupal::hasService(). I have a created a service in module A and in module B I have an ...
0
votes
0answers
32 views

Paragraph type can't delete individual items

I use Paragraph module Version: 8.x-1.5. Somehow I can't delete individual items anymore? Is there a settings somewhere I missed?
0
votes
0answers
43 views

Config block translation?

EDIT - Here is my block src code. The module directory has no other files except the .info.yml: namespace Drupal\config_block\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Core\Block\...
0
votes
0answers
26 views

Users created from back-end doesn't trigger Welcome email

For some reason any user that is created by an authenticated user on my site, doesn't receive a welcome email...even when the Notify user of new account checkbox is checked. After the user is ...
1
vote
1answer
20 views

Use image field in an entity query condition

How to use image field in a condition of an entity query? To get X nodes which have no image as value of field_image I've tried this: $nids = \Drupal::entityQuery('node') ->condition('type','X') -...
1
vote
2answers
34 views

How to get Media image values (alt and title) in Views?

I want to edit the Media library module View to show the images Alt and Title field value, but it is not in the available fields (only "Thumbnail(alt)" which prints the image). All available ...
0
votes
0answers
16 views

Contextual filter on daterange [on hold]

I'm working with Drupal 8 and looking for a way to have a contextual filter on a datetime range which would look this way /YYYY-MM-DD--YYYY-MM-DD for example and get all content whose period or date ...
0
votes
0answers
21 views

Failing to download pdf using Entity Print

I have created a view with the list of nodes and I would like to provide a "Download PDF" feature. For this I have connected "Entity Print" module, which works pretty fine with Dompdf and TCPDF (v1) ...