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

Drupal8 module development: hook_node_access not called

for my current site I have a content type that stores a user in an entity reference field. I want to allow the user referenced in this field to edit the data of that node. In drupal7 I would do that with a node_access hook - which I am not getting…
Rambazamba
  • 127
  • 8
4
votes
2 answers

What is the Drupal 8 equivalent of Drupal 7's "drupal_add_html_head" within a module?

I'm creating some custom modules for Drupal 8. They include some header modification for better Facebook integration. Here is what it looked like in Drupal 7 (SEVEN): $element1 = array ( '#tag' => 'meta', '#attributes' =>…
MotoRidingMelon
  • 2,347
  • 2
  • 21
  • 28
4
votes
3 answers

Displaying sub menu tree in Drupal 8

I have a menu tree like, Continent as parent and it has sub menu of Asia, Australia, Europe. etc and each continent has sub men tree of countries. In a node page and in a block I would like to list all the menus and sub menu trees of 'Continent'. In…
Senthil
  • 444
  • 1
  • 10
  • 23
4
votes
3 answers

Core search module, change markup

I want to remove the Search results string added in the search page from line 119 of core/modules/search/src/Controller\SearchController.php. if (count($results)) { $build['search_results_title'] = array( '#markup' => '

' . $this->t('Search…

Patrick
  • 104
  • 1
  • 12
4
votes
1 answer

Drupal 8 equivalent of taxonomy term converted to term id views

So in Drupal 7 it was very easy to pass a taxonomy term by name as a contextual filter and it USED to have the option of convert term name to id. What's the equivalent of that in Drupal 8? I've tried the validator as "taxonomy term name" and it…
user1470118
  • 412
  • 2
  • 9
  • 24
4
votes
4 answers

Drupal 8 Taxonomy term in twig

I want to enhance the title of a page with a taxonomy term value that has been set in a field. So the title looks like this: Title - [taxonomy-term-value] To modify the title, i overwrote field--node--title--[content-type].html.twig So far so good,…
Denis
  • 165
  • 1
  • 1
  • 12
4
votes
1 answer

Drupal 8 REST resource POST method

I need help to implement a custom REST API using POST method in Drupal 8. I have a REST resource plugin class, and a get() method in it. I am able to access this resource through GET method and is working fine. I have a post() method in the same…
Apin Pratap
  • 94
  • 2
  • 10
4
votes
5 answers

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 can do that via this code : $form['main']['image'] = array( '#type' => 'text_format', '#title' => t('image'), '#default_value' =>…
spacecodeur
  • 2,206
  • 7
  • 35
  • 71
4
votes
3 answers

Drupal-8 restful webservices only delivering HTML

I have a freshly configured Drupal 8.0 beta 12 with HAL, HTTP Basic Authentication, RESTful Web Services and Serialization modules enabled. The installation is in a subfolder (D8_beta12). When I access the web services for the first page created…
andi
  • 41
  • 3
4
votes
3 answers

Drupal 8 include part template

I'm trying to use Drupal 8, with an own theme, due big structure differences for my requirements I have a page--front.twig.html and a page.twig.html, I would like to create template parts as used in phrozn oder in a normal Symfony2 project, for…
felipep
  • 2,442
  • 1
  • 28
  • 35
4
votes
1 answer

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 code? I have tried with block_load function and entity_load but did not get the expected result. Please help me to solve it. $block…
user3810914
  • 425
  • 2
  • 5
  • 9
3
votes
0 answers

What are the differences between Drupal 7 and 8?

What will be the main differences/enhancements between Drupal 7 and 8? I've found some articles on Drupal 8 (Some by Dries himself) but haven't exactly found a consolidated list on the main enhancements of what's to come. Even though Drupal 8…
vgardner
  • 507
  • 5
  • 20
3
votes
0 answers

How to fix Drupal 9 Base url issue while using load balancer

since the base URL config is deprecated and our Drupal 9 Site is using load balancer we are facing issue setting up the base URL . instead of base URL its displaying the load balancer IP , any help regarding the same is appreciated Referred the…
John Aroza
  • 31
  • 4
3
votes
1 answer

In Drupal 8 , what the usage and function for the .post_update.php?

I saw the file of docroot/core/modules/menu_link_content/menu_link_content.post_update.php in my project. But I can not figure out what the destination for this file. Could any one can explain for it?
MyMercury
  • 39
  • 4
3
votes
1 answer

Accessing fields of an entity reference in a view (views-view-fields.html.twig)

So i have 2 content types Webinar Person Webinar has an entity reference field (label:speaker, id:field_person_speaker) Person (multiple values) I have a view (unformatted list of fields of content type webinar) on path /webinar with these…
kevinius
  • 4,232
  • 7
  • 48
  • 79