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
4
votes
2 answers

Ckeditor in Drupal 8 : how to remove tags if they don't have class attributes?

I'm using the "Allowed html tags" filter in Ckeditor - Drupal 8. I want Ckeditor to keep tags that have specific classes or IDs, and to remove if it has no attribute. For example : Keep span: text sample Keep span…
eviau
  • 71
  • 7
4
votes
3 answers

drupal 8: how to redirect route with route parameters?

I have created dynamic route in drupal8 with parameter. Now i need to redirect to this page based on user action. How can this be achieved? Page sample router code as below example: domain_site_settings.config_form: path:…
Raj
  • 291
  • 1
  • 4
  • 7
4
votes
1 answer

Drupal 8 Drupal.behaviors without jquery

Is there a way to add drupal behaviors to a theme without invoking jquery in Drupal 8? This is what the tutorial show: (function ($, Drupal) { Drupal.behaviors.myModuleBehavior = { attach: function (context, settings) { …
wolfhowling
  • 83
  • 1
  • 7
4
votes
1 answer

drupal 8 Calling a JavaScript function after an #AJAX event

I want that js script running after doing the ajax action. For example, its work for Drupal 7: Drupal.behaviors.events = { attach: function(context, settings) { $('#example').bind('ajaxSuccess', function(data, status, xhr) { >>code…
Jerzy Stuhr
  • 63
  • 2
  • 7
4
votes
3 answers

How to manipulate value before node is saved in Drupal 8?

I have an editing node form. When user enters new value and clicks on submit to edit the node, I first want to get the old node back, manipulate the value and then just save/update the node. Below is my solution, but it does not work. function…
O Connor
  • 4,236
  • 15
  • 50
  • 91
4
votes
1 answer

How to display the city and the postal code?

I have a site with Drupal 8 and I want to customize the templates of my pages. I use the modules: "Profile" https://www.drupal.org/project/issues/profile "Address" https://www.drupal.org/project/address Here is the template of the module…
Mathieu61
  • 61
  • 2
4
votes
1 answer

How to require a specific commit of a Drupal project?

I know this had been asked several times, but the other solutions don't work for me so the problem may be somewhere else. In a dependent project I require a package like this: "require": { "drupal/security_review": "dev-8.x-1.x#35ebae44" } but…
Onkeltem
  • 1,889
  • 1
  • 18
  • 27
4
votes
2 answers

How to create a rest view or endpoint for a taxonomy

I have a taxonomy vocabulary that has the following terms: Green Red White How would I go about creating a restful view for an endpoint that returns this list as an array of entity data for each term?
Chris Mitchell
  • 634
  • 10
  • 28
4
votes
1 answer

In Drupal 8 Commerce, how to get order id and product variation id from current cart programmatically?

I want to get: Order ID for the current user; All product variation ID from the current users cart; Prices for product variations; Images; Titles; I have the following: $store_id = 1; $order_type = 'default'; $entity_manager =…
Santo Boldizar
  • 1,255
  • 14
  • 17
4
votes
1 answer

Drupal 8 add javascript and pass data in a hook with custom module

I am building a custom module with Drupal 8. One of the requirements of the module is that it sets up a javascript file based on the configuration settings, which the user of the module sets up in module configuration. The javascript which needs to…
software_writer
  • 3,941
  • 9
  • 38
  • 64
4
votes
0 answers

Drupal 8 JSON API : Convert relative url to absolute url

I am using json api to fetch my sites content. The body field in the article contains some images which when fetched using json api returns image path in relative format (eg : sites/default/files/08-2016/abcd.png). But I want this images path in…
Subhash
  • 178
  • 1
  • 9
4
votes
1 answer

PHPUnit Xdebug with PhpStorm Breakpoint is not being triggered unless I disable listening button

I have a really strange situation where PhpStorm doesn't seem to catch my breakpoint unless I start the test with the listen button enabled, then after it starts, I then disable the button. See screen capture below and config files. Any ideas on…
Justin Levi Winter
  • 2,327
  • 2
  • 17
  • 30
4
votes
1 answer

drupal 8 views date range filter - 'is between' operator not inclusive for end date

I have an Event content type with a Date range field. I created a view of events and added an exposed filter for the Date Range field. I used the operator 'is between', so the user can enter a start date and end date to search between. If the event…
ZTCat
  • 66
  • 1
  • 6
4
votes
4 answers

Get Taxonomy Term ID by Node in Drupal 8

I'm trying to get Taxonomy data by particular node. How can I get Taxonomy Term Id by using Node object ? Drupal ver. 8.3.6
Arfeen
  • 2,553
  • 5
  • 29
  • 48
4
votes
1 answer

Problems using drupal / console

I installed Drupal Console Launcher as described in the documentation : curl https://drupalconsole.com/installer -L -o drupal.phar mv drupal.phar /usr/local/bin/drupal chmod +x /usr/local/bin/drupal It works fine and the 'drupal' command…
Pascal Pivaty
  • 97
  • 1
  • 10