Questions tagged [drupal-8]

Drupal 8 is the Drupal version that was officially released on November 19, 2015. Rather than using this tag, consider posting your question directly on https://drupal.stackexchange.com/.

Drupal 8 introduces major changes, such as the support for HTML 5, better support for web services, multi-language support, mobile devices, and a configuration API.

Use this tag only if your question relates specifically to this version.

Requirements

  • Web server: Apache, Nginx, or Microsoft IIS
  • Database server: MySQL 5.5.3/MariaDB 5.5.20/Percona Server 5.5.8 or higher with PDO and an InnoDB-compatible primary storage engine, PostgreSQL 9.1.2 or higher with PDO, SQLite 3.6.8 or higher
  • PHP: PHP 5.5.9 or higher

Related tags:

Resources

2837 questions
6
votes
1 answer

Passing variables to twig using hook_theme within a module

I'm fully aware how to do this in Drupal 7 so I will explain what I would normally do using Drupal 7. When making a custom module I use hook_theme a lot, it is very powerful and reusable! /** * Implements hook_theme(). */ function MODULE_theme()…
Jake Lacey
  • 623
  • 7
  • 24
6
votes
2 answers

Remove Welcome to in Drupal 8

How to remove "Welcome to" from header title on front page in Drupal 8 In drupal 7 you just add in page.tpl.php this part of code:
Edin Puzic
  • 998
  • 2
  • 19
  • 39
6
votes
1 answer

PHP PDOException: SQLSTATE[HY000] [2019] Can't initialize character set utf8mb4

I have drupal 8 installed on Centos 6. Here is my php and mysql -version output Server version: 5.7.9 MySQL Community Server (GPL) PHP 5.6.14 (cli) (built: Oct 16 2015 08:41:09) But i still getting a connection error PDOException: SQLSTATE[HY000]…
vaninv
  • 153
  • 2
  • 5
5
votes
1 answer

I am facing problem (csrf_token' URL query argument is invalid) with flag module at Drupal 8

I generated flag link $flag_link = [ '#lazy_builder' => ['flag.link_builder:build', [ $product->getEntityTypeId(), $product->id(), 'product_like', ]], '#create_placeholder' => TRUE, ]; Flag link is generated successfully. But…
Arif
  • 195
  • 12
5
votes
1 answer

Conditional class with Twig on div element

Can I change class added to a div element depending on the content of this div ? Like: "if the div is empty, add this class, else add this class" and targeting the div with an id or something else. If yes, how can I do that ? Thanks EDIT: I found a…
webmaster pf
  • 389
  • 1
  • 5
  • 23
5
votes
1 answer

Translating Drupal 8 Custom Route Paths with Parameters

I have the following route my_module.order_details: path: '/account/orders/{orderId}' Is there any way in Drupal 8 that I can translate this route path once? For all the other routes I have been getting away with adding one url alias in the…
5
votes
1 answer

Apply Drupal 8 Patch by Composer for fix multi fields on Signature Field

I try to patch the Signature Field Drupal module. I follow this tutorial (https://groups.drupal.org/node/518975) but I don't get any changes. What I try: 1-Run: composer require cweagans/composer-patches 2-Edit the composer.json "extra": { …
Nasser Ali Karimi
  • 4,462
  • 6
  • 34
  • 77
5
votes
1 answer

How to display the title of the node in plain text in TWIG on Drupal 8?

I created TWIG for my node, my products, my groups and my stores. I'm on Drupal 8. For my nodes, I want to display the title. I use the following code: {{ label }} But there is the markup inside and I do not want it. So I tried the following code…
ML19
  • 67
  • 1
  • 5
5
votes
1 answer

How to fix behat 'DMore\ChromeDriver\StreamReadException' in behat script

I am executing my behat script and getting the following exception : DMore\ChromeDriver\StreamReadException in /vendor/dmore/chrome-mink-driver/src/DevToolsConnection.php I am getting the following exception in my local and also in my Acquia…
paul po
  • 99
  • 1
  • 10
5
votes
1 answer

Responsive images in table

The image shall be responsive in the table cell and the background color shall fill all empty space. I am working on a Drupal site (ver 8.6.7) that shall make number symbolics displaying in table rows. I am using Drupal8 Zymphonies Theme 8.x-1.3 I…
Christer
  • 101
  • 10
5
votes
2 answers

If I have two content types with a relationship between them in Drupal 8, why would I want to put a reference field in both content types?

If I have two content types with a relationship between them in Drupal 8, in order to represent the relationship, I can put a reference field to the other content type in one of these two content types. But in this video tutorial, it shows an…
user8426277
  • 587
  • 3
  • 17
5
votes
3 answers

Deleting Content Files in Drupal 8

I have trouble deleting Files on Drupal 8. How can you delete any kind of Files for example in my case a picture file (jpg, png etc...). In Drupal 7, you have the option on the right side to Delete the file , but Drupal 8 does not have that option…
attila.hajdo
  • 79
  • 1
  • 10
5
votes
1 answer

Drupal form template suggestion

I'm trying to create a drupal form suggestion using : function pfe_theme_suggestions_form_alter(array &$suggestions, array $variables) { $suggestions[] = 'form__'. $variables['element']['#id']; } but after creating the…
Marwen Amri
  • 183
  • 1
  • 8
5
votes
4 answers

Permanently delete unused / orphaned files in Drupal 8

We had some serious mistakes in a PDF uploaded to one of our websites. But after "deleting" it from Drupal, it is still accessible through direct links. Drupal doesn't seem to delete it on its own. I still can find it in the table file_managed, but…
user4521733
5
votes
1 answer

AWS Elastic Beanstalk Drupal 8 Install Error: failed to create symbolic link 'sites/default/files':

UPDATE WITH SOLUTIONS: Instead of zipping the directory, I selected all the files and folder within the directory and compressed those. Then I changed the permissions of the zipped folder to 777. Also, in the efs-mount.config file, I changed the…
Jen
  • 156
  • 1
  • 3
  • 17