Drupal 8 is the latest version of Drupal. Avoid using it as the only tag, unless your question is only specific to this version, and does not involve non-core features, or core features that already have their tags.

learn more… | top users | synonyms (1)

0
votes
0answers
2 views

Multiple image upload with AJAX instead of increasing max upload size

I'm trying to add an image gallery to articles in Drupal 8, which I've managed to do using the Juicebox module. I've set upload_max_filesize in my php.ini to 5mb, and I've left the post_max_size at ...
0
votes
0answers
8 views

How to add a variable to a twig field template?

On a node page I would like to add a div which adds a mailto link which references another field on the node, e.g. <div class="questions"> <a href="mailto:Joe@example.com?subject=Question ...
0
votes
0answers
11 views

Combining forms

I want to have a fixed number of custom entity add forms combined in one large form, on the same page. Submitted through one submit action. Inline entity form is not really suitable for me in this ...
0
votes
0answers
5 views

Change Dropdown to checkbox in View

I'm using Content: Translation language (exposed) in my code, And I Have two Options - autocomplete - dropdown I'd like to have Checkbox, How Can I enable it? I'm using Drupal 8
1
vote
1answer
14 views

It does not work when installed as “subsite”

I tried to install Drupal 8.03 on a windows 7 64 bit server, with MySQL, Apache and PHP 7.03, using the default install procedure / script. Drupal is only one of the applications on the website and ...
0
votes
0answers
6 views

When I request a _format=json of a node, the default values of image fields are not returned. How do I get those?

In the content type I have created an image field with a default value. When I create a new node and decide "default value" is fine and I save the node then when I request a _format=json of this ...
0
votes
1answer
13 views

The EU Cookie Compliance module doesn't display the message

I just downloaded the EU Cookie Compilance module 8.x-1.0-beta4 and the legal message doesn't show in my page. First, I configured the module, and then set the Display EU Cookie Compliance popup ...
0
votes
2answers
42 views

Get parent of an entity reference

I have an entity reference inside node. How can I retrieve the parent node? I tried with the following code, where $node is my entity reference, but it doesn't work. $entity_ids = $query ...
1
vote
1answer
20 views

Create And in contextual Filter

I need to create AND in Contextual Filter, for instance: I Want to Get All English Node AND Italian Node, with particular Taxonomy. But I Can Have En and It, but even only en or only it, or even it, ...
2
votes
0answers
13 views

Correct way to validate config entities?

In Drupal 8, how do I validate a ConfigEntity? I tried adding constraints, but then I found out this only works for ContentEntity, not ConfigEntity. My ConfigEntity has 2 fields, and the options of ...
1
vote
0answers
10 views

Teaser is missing CKEditor when uncollapsed

I have text with summary fields on my entity and for some reason the ckeditor is present only on the body, not on the teaser if I uncollpse it. What could be the issue?
2
votes
1answer
91 views

How do I translate “Please fill out this field.” on the user registration form?

Obviously users need to add an email address to register an account. I'm using the Bartik theme. In Firefox and Chrome, if I don't enter a value for the email address and press submit, the form is ...
0
votes
1answer
15 views

How do I turn a select list into a radio button?

I have a list text field that I want to display as a series of radio buttons instead of a select (dropdown) list. In Drupal 7, I could change this on Manage fields. How can I do that in Drupal 8?
0
votes
2answers
28 views

Cache in hook preprocess page

I'm trying to get a value of GET variable in hook_preprocess_page(), but I'm having problems with the cache. Only the first time the code is executed, I can get the value of the variable to put it in ...
0
votes
0answers
13 views

Getting a menu delivered via REST

I am trying to get a menu via REST and I've created a new module and rest resource plugin that allows for GET on /entity/restmenu/{menu_name}. I can successfully return this example json using this ...
1
vote
0answers
16 views

Display nodes with the same parent node

Let's say I have a Region content type that have multiple entity reference to a City content Type. When I'm on a City page, I would like to display Cities of the same Region as the City page. How ...
0
votes
1answer
15 views

How can I create Menu items through hook_install()?

Like it was said in subject, how would I do that? I need to create menu items once after module install and have the ability to edit them if needed. module.link.menu.yml won't give me that ability. ...
-1
votes
0answers
18 views

How do I add a view to a custom module? [on hold]

I want to create a module and add a view to it. I realized I should use getViewsData(), but I do not know how to use it. Who can help me?
1
vote
1answer
22 views

Getting the value of a taxonomy term reference field

I have a content type (Movie) with a taxonomy reference (Movie rating) for which can get multiple values. I would like to use the template node--movie.html.twig and get the first value inserted in the ...
0
votes
1answer
12 views

Error with RouteBuilder.php [on hold]

I meet a 500 error (on Chrome) when I want to go to settings page of the installed themes. Location ...
0
votes
0answers
17 views

Fatal error: Class 'Symfony\Component\HttpKernel\HttpCache' not found [on hold]

I was authenticate a user in index.php and forwarding the request using the method , HttpCache::forward . The server is spitting out Fatal error: Class 'Symfony\Component\HttpKernel\HttpCache' not ...
0
votes
0answers
19 views

Drupal 8 site migrated from Drupal 7 shows themeless and blockless front page

I've installed a brand new Drupal 8 site (http://checkwmiplus.edcint.co.nz) with next to no configuration, default theme etc. I then ran Drupal Update against a Drupal 7 site ...
2
votes
2answers
29 views

How can I perform an operation programatically when the value of a user field is changed?

On my user accounts, I have a text field, field_nickname. Users can change this at any time. When they do change it, however, when the user account is saved I want to copy the old value for ...
0
votes
1answer
24 views

Using the Big Pipe approach for listing pages that are driven by Solr Index

We are working on a website where we might end up having thousands/lakhs of nodes. So we are planning on using Apache Solr for the listing pages as well. Having researched a little bit about Big ...
1
vote
1answer
19 views

Exposed Filters in Drupal 8

I am not able to get exposed filters to work in Drupal 8. Here is a screenshot to help me while I explain some of the issues I want to filter by the title of a content type. This title was ...
0
votes
0answers
10 views

How to get correct language code during installation?

I am programmatically creating some content during installation of my profile and I need to set the language for this content, otherwise it will be in English(which my site is not) and there will be ...
1
vote
1answer
18 views

Can we add the ?destination query parameter to a link from yml configuration?

When creating a link from yaml ie: mymodule.links.action.yml my_module.my_entity.add: route_name: node.add title: 'Add My Entity' route_parameters: node_type: 'my_entity' appears_on: ...
0
votes
1answer
19 views

Building a custom module holding a simple form, submitting to the database [on hold]

I'd just started on Drupal and I'm pretty lost after creating my own custom module. So far I've only created a page that shouts 'Hello World'. What I want to do is just create a simple page that holds ...
0
votes
1answer
13 views

How to sort on different columns in the same view Drupal 8

I'm trying to build a Glossary View in Drupal 8. Let's say I have 3 content types: Person, Article, Event. I want sort by title ASC for Article and Event, but sort by Last Name for Person. So that ...
1
vote
1answer
24 views

Add font to bootstrap sub-theme

I use drupal 8, and Bootstrap theme. I created a sub-theme. I would like added one font that I downloaded, to use it in my sub-theme. I read contradictory things to realize it. For example that ...
1
vote
1answer
21 views

Converting a helper class into an Entity

I am working on a Drupal 8 module, and a separate module of examples, on how to use the first module. In my example module, I have a function in my controller that looks like this: public function ...
0
votes
2answers
25 views

Combine several field as a new field

say my custom content type has 3 different fields: max, min, mean. What I want to achieve is group them into a new field say statistics so the new statistics field will have all the values in fields ...
0
votes
1answer
16 views

Configuration Management is broken between two site environments, I have no idea how to fix it

I started working on a d8 site two weeks ago; there are two site environments: @dev and @staging, on different servers. I have been developing the site locally (adding views, pages etc.) and using the ...
0
votes
1answer
25 views

Using Twig how can I get the summary of the body field to use in a template?

So I have a textarea with summary and I want to display the summary before the content. So if I just use {{ content.body }} the text is displayed without the summary. How can I get the summary ? {{ ...
3
votes
1answer
40 views

How to assign a specific role to each newly registered user?

Is it possible in Drupal 8 to assign a specific role to each newly registered user?
0
votes
1answer
36 views

How do I print the {{messages}} variable?

In Drupal 7 I was able to do something like this: <?php echo $messages; ?> It seems this variable is no more in Drupal 8. {{messages}} // This returns NULL on {{dump(messages)}}. I ...
4
votes
1answer
34 views

How do I store filtered markup?

As instructed, I am looking at porting Message to Drupal 8. It uses token to generate the message arguments and so they are HTML escaped. This is the current code: foreach ($matches[1] as $delta ...
0
votes
1answer
21 views

HTML link support for Twig

In the menu.twig.html file I'm using the "link" function, but it displays raw HTML, if I use HTML tags in menu titles. Is there any way to render HTML links from menu.twig.html?
0
votes
1answer
28 views

Customize admin form field in

I need to customize the aspect of one single field in a editing admin form. More specifically I want change the height of a multiselect field. Have I to create complete admin sub-theme containing just ...
0
votes
1answer
21 views

Get menu item of a content type

Is it possible to get the menu item of a certain content type through the API? The idea is to improve Markus Orenstrat solution to set the active trail based on the content type. As it stands it ...
1
vote
1answer
33 views

How to set a value programatically only when a content type is saved for the first time?

I'm trying to record the user agent string into a text field (field_useragent) the first time a content type is saved. This is what I tried: /* * Implements hook_ENTITY_TYPE_insert() */ function ...
1
vote
1answer
25 views

Get the body of content referenced in an Entity Reference field in node

I have a content type "event" which contains an entity reference to another content type "speaker". The speaker content type contains image and body fields. If I select a speaker for my event, I am ...
1
vote
1answer
40 views

Drupal 8 REST - How to export Drupal 8 Main navigation menu with REST service (JSON)

I have tried to GET main menu with rest path "/entity/menu/{menu}" but all I get in response JSON is a menu properties as uuid,language,id... without menu structure (links...). { "uuid": ...
-2
votes
0answers
18 views

My page title is not showing [on hold]

My page title is not showing and I am sure it not a setting problem.
3
votes
1answer
22 views

Why can't I add an existing field to the user accounts on Drupal 8?

On Drupal 7, you can add fields that have been added to nodes to user accounts. At admin/config/people/accounts/fields, scroll down to Add related fields and simply select the field, easy. But in ...
3
votes
1answer
30 views

Multi level menu in Drupal 8?

I've created a multi-level main menu in Drupal 8, all levels need to show by default (they are revealed on hover/tap). Unfortunately when adding this menu as a block, Drupal states: The menu will ...
-1
votes
0answers
21 views

When I am logged-in the page doesn't look the same as when I am logged-off

Does I need to include something in the code or in settings. I have problem what page dont look the some when I am login or not. Like on photo down. Some help or suggestion? This is my code. Does I ...
0
votes
1answer
24 views

Sharing the same code base and one database

I would like to have multi-sites that share the some code base and one SQL database in Drupal 8. Is this possible and recommended? I am interested also in security concerns. Is this safe?
0
votes
0answers
20 views

Kint breaks in template and doesn't allow me to view anything

in my template I am trying to view the contents of Childen in a form template. <form{{ attributes }}> {{ kint(children) }} </form> However, the result I get is a useless broken kint ...
3
votes
2answers
34 views

How to use entityQuery to select if a multiple value entityReference field does not contain the id

I have an entity with a user entityReference field, which may contain multiple values. I wish to select using EntityQuery the nodes that do NOT contain the uid in the query. $query ...