Top "Drupal-8" questions

Drupal 8 is the Drupal version that was officially released on November 19, 2015.

How to create an entity reference field in Drupal 8 programmatically?

I want to create an entity reference field in Drupal 8 using my custom module. Like when someone clicks a link …

drupal drupal-8
How to get image url from uri in Drupal 8 template

I'm trying to create my own image field formatter. I've followed these instructions (http://www.sitepoint.com/creating-custom-field-formatters-drupal-8/) and right …

drupal twig drupal-8
Drupal 8, add an image field from a BuildForm with preview

I created a custom form from a buildForm function. In this form, I would like add an image field. I …

drupal-forms drupal-8 drupal-fields
Drupal 8 - Get the image width / height / alt / etc.. in a twig or preprocess file

I'm trying to get the width and height of an image in a preprocess file. I managed to generate the …

drupal-8
How to get custom block content in drupal 8

I have created a custom block "admin/structure/block/block-content". How to get the field from a custom block by …

drupal-8
Drupal 8 create field programmatically

I created a custom module for Drupal 8 that allow the users to choose a Content type in order add some …

drupal drupal-8 drupal-fields drupal-field-api
How do I check if the current page is the front page from node.html.twig?

I'm currently trying to integrate a website with Drupal 8. My front page is just a bit different than the other …

templates variables twig drupal-8 frontpage
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) …

mysql pdo drupal-8 utf8mb4
How to update or create paragraph fields programatically in drupal8

Below is my solution with an example, that may help you. Update existing field $target_id = 62; $paragraph = Paragraph::load($target_…

drupal-8 drupal-entities
How to add custom HTML on user profile page in Drupal 8?

When a user logs in, it takes them to their /user page. This page usually has the default text on …

user-profile drupal-8