Drupal 8 is the version of Drupal currently in development which will be the next major release.

learn more… | top users | synonyms (1)

0
votes
1answer
13 views

How to use different entity info per entity bundle?

I have three specific vocabularies that reside on different URIs and I need to have the Field UI configuration available for those URIs instead of only at one specific URI. How could I configure ...
0
votes
1answer
33 views

Link's href value gets lost

I am trying to make a link on node by returning this array(The array is being formed in the function by the name buildLinks() ): $links[$key] = array( 'title' => $definition['title'], ...
0
votes
1answer
22 views

Drupal 8 Theme a contact form

Hi i'd like to theme a contact form in Drupal 8. I'd like to put divs around form elements (using bootstrap). I also want to put some classes on certain elements (submit button, the form itself). ...
1
vote
1answer
20 views

Drupal 8: How do you migrate block content from a dev to a production site?

I've finally started looking at Drupal 8 seriously and I'm particularly interested in the configuration management. I've come across something that could be a little bit problematic and that's ...
0
votes
1answer
31 views

getStorage('block')

I try to load the body field from a custom block in Drupal 8. $block = \Drupal::entityManager()->getStorage('block')->load($block_id); The result in $block is NULL. A similar code for a node ...
0
votes
1answer
29 views

How do I share views on multisite in drupal 8

Is it possible to have a multisite set up in drupal 8 and create view on Site A and have that appear on Site B? I cant find anything in drupal documentation for sharing views. I can share users, ...
0
votes
1answer
26 views

Declaring highwater property in Migrate for Drupal 8

I would like to know how to correctly define the highwater property when using Migrate for Drupal 8. I am doing an import from a legacy non drupal database and I should be able to update only the ...
0
votes
1answer
22 views

What is the recommendation for mapping state?

The configuration in D8 is nicely mapped in config schema file so any developer knows what configuration changes can be made. But what about state? Is there a recommended way to map state? Or is it ...
0
votes
1answer
33 views

How to create menu when dynamic routes [duplicate]

This link https://www.drupal.org/node/2122201 suggest us to make use of route_callbacks when we are using dynamic routes.Can someone tell me how to make use of this route name in *.links.menu.yml file ...
1
vote
1answer
47 views

How do I know when Hooks are called and in what order?

I want to alter a HTTP header and I am looking for the appropriate hook to use. I can tell a general time of when some hooks are called but not exactly when. How do I know exactly when hooks are ...
0
votes
1answer
22 views

Menu in Drupal8

I am currently using below code to generate routes: foreach($this->hardcopyEntityManager->getHardcopyEntities() as $entity_type => $entity_definition) { $route = new Route( ...
0
votes
1answer
32 views

How to implement template file that would reside in database?

I was wondering if it would be possible to have a template "file" that would be stored only in DB and would not exist physically? Twig tempaltes are parsed from files only once and they are processed ...
0
votes
2answers
38 views

Why does my site whitescreen with content? [closed]

I am creating a drupal 8 site. I have only installed two modules so far, Devel and Varnish. However anytime I try to create an article and save it any page on the site that isn't an admin page is ...
0
votes
0answers
16 views

How to hide row cell when using table in forms?

I have a field widget that has multiple values per field and some are values or other form types that do not render any visible data. I want to use the table element to encapsulate these fields into ...
0
votes
2answers
25 views

How to find the default value or change state of a Drupal 8 form element?

I'm putting together a fairly complex form with Drupal 8 (currently building on beta 7). In my validation function, I need to be able to detect whether a field, which was populated with default ...
3
votes
1answer
72 views
+50

How to hijack the route response?

I have a configuration form that if it wasn't previousely configured should be the only thing that the user is able to see. I would like to hijack the response for the current page and display the ...
0
votes
1answer
43 views

Menu links for Dynamic path

I have created routes for several content entity making use of route built event in Drupal 8 and now I want to create menu links for the same routes. I searched several places but couldn't come up ...
0
votes
2answers
61 views

How to get the field values with EntityQuery?

I am working on a query filtering form that lists entities. I have various 'range' fields and I would like to display the min and max values. Is it possible to retrieve field values with EntityQuery? ...
0
votes
0answers
36 views

Adding a class to a region

I am working on my theme in Drupal 8 and I want to add a class to my header div. I tried adding this to the region.vars.php file. if ($region === 'header') { $variables[header]['class'][] = ...
0
votes
1answer
29 views

How to customize Number of posts on front page in drupal 8

I went to URL: admin/config/system/site-information I can't find Number of posts on front page settings available there like Drupal 7 has. I am using drupal 8 version : 8.0.0-dev any help is ...
0
votes
2answers
50 views

406 error on ajax calls in Drupal 8

Yesterday I upgraded from drupal 8 beta 3 to beta 10. I noticed all my ajax calls are now getting error 406 (Not acceptable). This is my route: switch_customer.user: path: ...
0
votes
1answer
27 views

Getting access denied when altering user view route

I want to display custom content for the user profile page instead of the entity view so I am altering the entity.user.canonical route and I am setting a custom controller and title compared to the ...
0
votes
0answers
28 views

Creating account type where email not required to be unique

I'm developing a platform for Drupal 8 where there are several account types: students, their parents, teachers. The students are young and we want their accounts associated with their parents' ...
1
vote
1answer
29 views

How to embed plugin configuration form elements into another form?

I have a form that lists entities and each of the entities has a checkbox. The form also contains a list of actions(Action plugin) that can be performed on selected entities as a select list. I would ...
0
votes
1answer
51 views

Drupal 8 different layouts in theme

How do i create theme that has different regions for every node? For example i want my frontpage to have different regions than some other page that represents content.
1
vote
2answers
74 views

Drupal 8 modules support

How do i know which drupal 8 modules are supported by Drupal 8 versions? For example is Page Manager 8.x-1.0-alpha8 module supported in every Drupal 8 version and if not how do i know which Drupal 8 ...
2
votes
1answer
34 views

How to hide comment section present in render array?

I have generated an array in Drupal 8 which is created by using viewbuilder in this manner: $content = $this->entityManager()->getViewBuilder($entity->getEntityTypeId())>view($entity, 'hardcopy'); ...
1
vote
1answer
32 views

Wrong caching of embedded views block

I am having trouble with the Cache API in Drupal 8. I embedded a views block with pagination through a field preprocess function into a node. When caching is off, I can normally use the pager and will ...
0
votes
1answer
43 views

Switch a language programatically

Looking for a way to change between languages on our site, the Drupal 8s LanguageManager doesn't seem to have a straightforward method for this. We cannot use URL-switching, just want to do this ...
2
votes
0answers
51 views

Using the right t()

In Drupal 8, it seems as though object-oriented code is encouraged to use $this->t() instead of the global function t(), by either adding StringTranslationTrait to the class, or extending a core ...
0
votes
1answer
28 views

How do I add a menu task to /node path?

I want to add a custom tab after "Edit" but can't figure out how to do so. I added a mymodule.links.task.yml file entity.node.import_form: route_name: entity.node.import_form base_route: ...
0
votes
1answer
26 views

Custom validation rules for content entity fields

So I want to store an entity_type in a string field in my content entity. Since the list of entities can change over time, I can't use a list_string field with allowed options. I don't know if ...
1
vote
0answers
33 views

Drupal 8 static pages [duplicate]

How do i create Drupal 8 static pages that are translatable(3-lingual site)? I already have HTML code and about 15 static pages which some have dynamic content(latest news etc). What's the best ...
0
votes
0answers
34 views

How to position javascript file as the last one to load?

In Drupal 8 the weight for javascript files in libraries is not supported, or at least only negative values are allowed, which means I am only able to position them at the top of the list (i.e. load ...
0
votes
1answer
23 views

What is the difference between base tables and data tables for content entities?

Recently, Views was updated to use data tables (the data_table annotation on @ContentEntityType) by default. See the change record at https://www.drupal.org/node/2433153. This caught me out since I ...
1
vote
0answers
29 views

Distribute configuration to several sites

There should be several sites, starting with something like a similar distribution, but over time, each site might get some individual modules. Yet, I'd like to keep the site updated with new versions ...
1
vote
1answer
74 views

Drupal 8 project structure

I was wondering what would be the best way to setup a Drupal 8 website that has about 15 mostly static pages in three languages? Static pages are somewhat similar but do contain different content. ...
1
vote
1answer
42 views

User login link is always visible in menu

I have created user login link in the user account menu but the link is visible all the time(even for logged users). The user profile menu link and the user logout links are displayed properly(they ...
0
votes
1answer
25 views

Filter module won't let me add nested values to my configuration

I'm working on the D8 port of my xbbcode module; my latest sources are here. The module is supposed to let administrators enable individual BBCode tags either in the global default settings or in an ...
2
votes
1answer
75 views

Setting Up Drupal 8 REST Post Request

I am having issues sending a POST request to create a node with Drupal 8 Core REST. Here are the steps I have went through several times. Note that these steps are in effort to produce a working ...
1
vote
0answers
27 views

Content admin no longer works after update from beta 7 to beta 9 [closed]

I get a DB-exception when I try to list my content in admin: Everything else works fine except for this bugger. <em ...
1
vote
1answer
23 views

How to uninstall a text format created by a D8 module?

My module creates its own text format upon installation by having a file named config/install/filter.format.{format}.yml. However, I can't uninstall and reinstall the module, because the format ...
0
votes
2answers
26 views

Changing filter plugin settings before they are saved

(This is for D8, although parts of this filter settings API were already in D7.) As far as I understand, a filter plugin exposes its settings solely with FilterBase::settingsForm() - the central ...
2
votes
1answer
155 views

Running Drush Within Drupal 8 Instance Returning Error

I am running drush version 6.2.0 and the latest Drupal 8 beta on Dreamhosters. When I run drush cc all within the sites directory, I receive the following error immediately after executing the ...
0
votes
1answer
34 views

How do I add a menu item to the main navigation from a custom module in Drupal 8?

For my custom Drupal 8 module I want to add a link to the default main navigation menu of the site. What parent ID do I have to give to insert my menu item into the main menu? I currently have the ...
0
votes
1answer
71 views

Passing path arguments to a form builder [closed]

I'm trying to understand how to port the following D7 code to Drupal 8. function x_menu() { $menu['x/form/test/%/%'] = [ 'page callback' => 'drupal_get_form', 'page arguments' ...
2
votes
1answer
40 views

How can I save/load my Entity from a different database in Drupal 8?

For a custom Drupal 8 module I am integrating data from a separate database (other than the default drupal database) by defining a new Drupal entity in my module. How can I configure my Entity class ...
1
vote
1answer
43 views

Drag and Drop Sort Custom Entities

I am looking for a simple way to sort my custom entities through a drag and drop interface and display them in the custom order in my views. The best way would probably be to add a weight basefield ...
0
votes
1answer
22 views

How do I Bulk Edit Fields or Taxonomy of Nodes in Drupal 8?

I'm working on a site that needs bulk tagging on nodes. The D8 core View Bulk Operations Port is "simple" (https://www.drupal.org/node/1823572) and it doesn't have "modify entity values" which I used ...
0
votes
1answer
116 views

Ajax http request terminated error while installing a Drupal 8 site [closed]

I have installed WAMP Server for Postgresql and during the time of installation of Drupal (version 8), I got this error: Drupal\Core\Config\UnmetDependenciesException: Configuration objects ...