Top "Drupal-8" questions

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

Get URL parameters inside custom module

I've created a custom block like this: class HelloBlock extends BlockBase implements BlockPluginInterface{ /** * {@inheritdoc} */ public function build() { $config = $this->…

php drupal drupal-8
Creating a link from node ID in Drupal 8

I am checking out Drupal 8 and try to generate a link based on the node ID of an article. In …

drupal drupal-8
Extract Url & Title from link field in Drupal 8?

I'm trying to retrieve the URL and the Title values of a Link field in Drupal 8. In my custom controller, …

php drupal drupal-8
Drupal 8 images with image style

In drupal 7, i use function image_style_url('style', uri) to generate new image with style and return image's path. …

image drupal drupal-8
drupal 8 get taxonomy term value in node

Drupal\node\Entity\Node Object ( [in_preview] => [values:protected] => Array ( [vid] => Array ( [x-default] => 1 ) [langcode] => Array ( […

drupal-8
How to programmatically create a node in Drupal 8?

I'm designing a new module in Drupal 8. It's a long-term project that won't be going public for a few months …

php drupal drupal-8
How to create a query in Drupal 8

I am used to using db_select in drupal 7 but now it's deprecated in drupal 8 So, If I need to …

php mysql drupal drupal-8
How do you check if a field is empty in drupal 8?

I have a field added to the content type of basic page. It is a select box, which is either …

php drupal drupal-8
Get cookie from Twig template

I'm trying to access cookies I set in my Drupal website. I created two cookies on a form submission : with …

symfony cookies twig drupal-8
How to throw 404 error in Drupal module?

I need to throw 404 error in module. Or may be there are any possibility to set required option for menu …

drupal drupal-7 drupal-8