Top "Drupal-8" questions

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

How to programmatically get content type name in Drupal 8

I'm working on Drupal 8. And I want to get content type machine name and label. Here is my code: $cont_…

content-type drupal-8
How to enable PHP OPcode caching for Drupal 8?

I want to enable PHP OPcode caching for Drupal 8 installation. I have the following in Xampp php.ini. However, I …

php drupal xampp drupal-8
Drupal 8: delete all nodes of the same type

I have a need to remove all nodes of the same type in Drupal 8 (there are over 7k of nodes). …

drupal-8
Drupal 8, get programmatically the list of fields of a custom content

I want create programmatically a custom content (custom content created via the admin UI). But, before the creation, I want …

drupal-8 drupal-nodes drupal-fields
Drupal 8 custom block (module) create twig template file

I have a custom Module that creates a custom Block which has field elements. This all works fine but I …

php drupal-8
Using preprocess hook on specific node type in Drupal 8

I've had success using preprocess page hooks such as: function mytheme_preprocess_page__node_front(&$variables) { ... } and function mytheme_…

drupal-8 drupal-hooks drupal-templates
How to use docker with drupal and drush?

I'd like to use drush. It needs to run in the drupal container. There's also a drush docker repo. But …

drupal docker docker-compose drupal-8 drush
How to clear cache programmatically in Drupal 8?

I am working on a Drupal 8 site. This site was working. I recently moved to another machine. It is showing …

caching drupal drupal-8
How to use an image style in a Drupal 8 twig template?

I am trying to print an image using an image style that I've created in my drupal 8 theme. I can …

drupal twig drupal-8
Accessing individual fields in Drupal 8 views templates

I'm having trouble doing something that I think should be relatively simple drupal 8 views. I have a content type called …

twig views templating drupal-8