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)

1
vote
1answer
12 views

Installation on OpenSuse Leap

I get following two warnings: Due to the settings for ServerTokens in httpd.conf, it is impossible to accurately determine the version of Apache running on this server. The reported value is ...
0
votes
0answers
19 views

Changing a node's content type [on hold]

In Drupal 7, I can easily switch a node's content type by using Node convert. Node Convert, however, has not been ported to Drupal 8, nor does there appear to be much enthusiasm for the port. If I ...
0
votes
0answers
14 views

Formatting email sent with Contact form

I created a custom form (adding some additional fields) using the Contact module from the core of Drupal 8. When I submit the form is sent an email containing all values, but it is really bad ...
-1
votes
1answer
16 views

Sending email in Drupal 8 [on hold]

I created a small form on my D8 website and now I try that in the submissions me an email is sent but I have a problem when sending "error sending email". This error appears also when I try to send ...
0
votes
1answer
15 views

How to correctly configure settings.php to use reverse proxy and ssl termination

In settings.php there is the section "Reverse Proxy Configuration". It suggests settings to add when you are using a reverse proxy and SSL termination. Nginx is listening on port 443, adds the ...
2
votes
1answer
38 views

Linux distribution suited for a clean and easy Drupal 8 install [on hold]

I am experiencing a series of issues trying to prepare a server on my professional environment for running Drupal 8. By default, the IT team will install CentOS 6. More precisely, we are running ...
0
votes
1answer
10 views

Conditionally load PHP class

I made 2 custom modules: boutique and paypal. paypal is a dependance of boutique. I check if paypal is enabled, with the following code. namespace Drupal\boutique\Form\Multistep; use ...
0
votes
1answer
7 views

D8 date popup on exposed filter

How can I get a date popup on the exposed filters of a view on D8 ? I do not see the option, is it on D8 yet?
2
votes
1answer
35 views

How do I only render the main content without wrapping it with the theme or side blocks and menus?

I want to output a google map div with a side panel in my drupal 8 moodule. So no need for blocks surrounding my main content. The question is how do I tell Drupal to only render main content using ...
1
vote
1answer
13 views

Drupal 8 installation (bash) script. I want the latest stable v8 version each time. But how?

My Drupal 7 script utilised a make file which specified '7.x' as the Drupal version to install, drush make would fetch the correct core files. My current Drupal 8 script uses git to clone and then ...
1
vote
0answers
21 views

Theming forms. Form-element

Please, help. Is it possible implement different templates for form-element.html.twig? For form 'user-form' one template, and for other forms second template.
1
vote
1answer
25 views

Is there any way to count the number of items in cache?

In Drupal 6, I used to be able to look up the number of items via {cache_MODULENAME} table direct in SQL. Is there any way to look it up via the cache API?
1
vote
1answer
26 views

Where are all the controller classes instantiated?

In Drupal 8, if I want to create a form, I have to define a class inside the module folder like this. class MyForm extends FormBase{ public function getFormId() { return 'my_form'; } ...
0
votes
0answers
19 views

How do I add a media image field?

I think it's quite confusing, I have installed these modules: Media Entity Media Entity Image Entity Browser When I try to add an image field, I have no widget for Media like it was in Drupal ...
0
votes
0answers
10 views

Gif animation and responsive image styles are not working

I have a multiple image field and need it to upload images and animated gifs. These images might be resized. When this happens, the animated gif loses its animation. Has anyone solved this problem in ...
0
votes
0answers
10 views

How can I set the focus on the CKEDITOR textarea after I change it to display:block?

I have a CKEDITOR textarea that is by default set to display:none on comment_button click I set the CKEDITOR textarea to display:block. How can I set the focus on CKEDITOR textarea after I perform ...
1
vote
1answer
20 views

Equivalent to template_preprocess_search_results()

Is there something equivalent to template_preprocess_search_results() in Drupal 8? I just realized that this function has been left out in Drupal 8 for some reasons, although ...
1
vote
1answer
31 views

Display field collection items by using twig

I'm using the field collection module in Drupal 8 to encapsulate event informations so I've got a field collection with six sub fields (place, starting time, etc.). In my twig template ...
0
votes
0answers
10 views

403 error on creating node using REST

I am trying to create an article node using REST API, but i keep getting 403 error. I have given necessary permission. I am trying it with admin login, curl --include --request POST --user ...
2
votes
1answer
17 views

Add tab / local task to a node

I've created a module called hotel_reviews. I've created the route node/{node}/reviews using hotel_reviews.routing.yml. hotel_reviews.content: path: '/node/{node}/reviews' defaults: ...
1
vote
0answers
16 views

Drupal 8 View - get url field

How do I get the URL, not the link html for a taxonomy field in my view. For Drupal 7 I found this ticket: How do I get the raw URL as a field in Views? This mentions getting the content: path - ...
0
votes
1answer
25 views

Start page count from 1 with views pager

Is there a way to start the page count from 1 instead of 0 using views pager? Maybe using aliases or some module? By default, the first page is displayed with the URL parameter ?page=0, the second ...
0
votes
1answer
22 views

How can I see the created date of a node in a view?

How can I see the created date of a node in a view? I don't see it as an option.
0
votes
1answer
16 views

How to pass variables to OpenModalDialogCommand

Drupal 8. Clicking the upload button on Form1 should open UploadForm in a modal dialog. /** * Callback to display a modal. */ public function ajaxSubmit(&$form, FormStateInterface $form_state) ...
0
votes
1answer
22 views

How do I alter the submit function?

I want to do array_unshift for submit function in D8. Array_unshift working perfectly for validate function but not submit function. Below is my code: function example_form_alter(&$form, ...
1
vote
0answers
15 views

multisite with shared user, shared session,separate role

I'm trying to build Drupal multisite with separate DB but shared user, session and separate roles. I did this in settings.php: Master/default/parent site: $databases['default']['default'] = array ( ...
0
votes
0answers
13 views

How to get node type label from node object in drupal 8

I'm trying to get the bundle label (node type label) of the node from a node object in Drupal 8. This works, but seems long-winded: $node_type = ...
0
votes
0answers
17 views

How to programmatically render a field collection in Drupal 8?

For "normal" fields, this works: $node = \Drupal::routeMatch()->getParameter('node'); $field = $node->field_foobar->value; print render($field); But if the field is a field collection, it ...
0
votes
1answer
12 views

How to access referenced entities programmatically

I have an entity (a node) with a term reference field. I'd like to access the referenced term entities programmatically, i.e. the fully loaded term objects. Note that my question could equally apply ...
1
vote
1answer
20 views

How do I load the node edit form?

To load the login form I am using the following code. $form = \Drupal::formBuilder()->getForm('Drupal\user\Form\UserLoginForm'); I would like to load the form to edit a node. How can I achieve ...
0
votes
1answer
17 views

Export block content in drupal 8

I have made my custom block content. I created a block with it and I assigned it to a region. How can I export the actual block content not the block type?
0
votes
0answers
25 views

How to reindex a particular node in Drupal 8?

I want to index particular node on update, insert how to do it in Drupal 8? In drupal 7, we use the function function _node_index_node() I want to use the same function in drupal8 for my Drupal 8 ...
4
votes
4answers
161 views

How do I correctly setup caching for my custom block showing content depending on the current node?

I have this very basic block which just shows the current node's ID. <?php /** * @file * Contains \Drupal\mymodule\Plugin\Block\ExampleEmptyBlock. */ namespace Drupal\mymodule\Plugin\Block; ...
0
votes
0answers
26 views
+100

Cache remains stale for custom blocks after editing

My Drupal 8 website consists of multiple custom blocks created from the drupal backend user interface. As I went from dev to production settings and activating Internal Dynamic Page Cache (set to 1 ...
0
votes
0answers
27 views

How can I check in Drupal 8 an externally set $_COOKIE?

I would like to check whether a Cookie exists, and if so, get the value. But it looks like Drupal is blind to external cookies that have not been set inside Drupal. $mycookie = ...
0
votes
1answer
20 views

migrate paragraph fields from drupal7 to D8

I have migrated d7 website to D8 version using the core migrate_drupal_ui module successfully but the paragraph module was broken upgrade path which results in final that the paragraph bundles not ...
-5
votes
0answers
31 views

How to create site programmatically [on hold]

Im working on Drupal 8 project that require me to make authenticate user with a specific role create a site automatically without any manual process. The flow will be similiar like: Create site ...
1
vote
4answers
81 views

Why doesn't 'drush cc all' work?

I installed Drush, but most of the commands doesn't work, I guess. I tried drush cc all and got the following output: Command cache-clear needs a higher bootstrap level to run - you will need ...
1
vote
1answer
18 views

Drupal8 - Templating a all form in detail on same page template

I need to display a form with complex HTML structure in my custom module. And not a single field had the same wrapper structure. So I need more flexibility in my template custom.html.twig than just ...
0
votes
0answers
17 views

Upload an Image File using REST API in drupal 8 (Using multipart/form-data)

I want to send an image file using REST API in Drupal 8 along with a registration form. I have built a custom API to save the registration form. For the files i have created another API to save data ...
2
votes
1answer
25 views

drupal 8, how change the base url?

In drupal 7, we can quickly change the base url of the website. Now, how can I do that with drupal 8 ? I must migrate my local website to an online server :) Thant you !
1
vote
1answer
18 views

What is the alternative of hook_custom_theme in Drupal 8?

I need to change the theme based in custom criteria. Some nodes should be displayed with one particular theme and others with the admin theme. In D7 I could simply use the pathauto module and set ...
1
vote
2answers
43 views

How do I get the Unix timestamp?

I want to use format_date(), but it requires a Unix timestamp and my dates are ISO. Is there a drupal way to convert ISO date to Unix timestamp? If I use strtotime, I lose my timezone offset.
0
votes
0answers
17 views

How to display more fields in an autocomplete reference field in Drupal 8

In an autocomplete field only the title of the entity reference is displayed to select it. I would like to display more fields to be more accurate in the selection, but after many research and try ...
0
votes
1answer
19 views

Sort content in a view by taxonomy term and use terms as headlines in drupal 8

Say I have a content type books and a taxonomy vocabolary book categorys i.e. book categorys: - Novel - Short Story Now, what I would like to display in a view is: Novel Novel 1 Novel 2 ...
1
vote
1answer
15 views

Drupal 8 Views Content:nid missing?

Hopefully this is a really stupid question. Is Content ID in Drupal 8 the same as Content Node Id? Installed Drupal 8.1.0 on iis php7. Everything is working fine except when I create a view I do not ...
3
votes
2answers
54 views

How to read YML file in D8?

I have been trying to figure out how to decode ( also try encode) my YML file so I can have full control over on PHP array. I try this .... And as you can see I did not get the information inside ...
0
votes
0answers
17 views

multisite keep pointing to default site

i'm configuring multisite in drupal 8, i did: create sites.php (copy from example.sites.php) $sites = array( 'sub0.sub1.domain.com' => 'sub0' ); then i creates: sites/sub0 folder ...
0
votes
1answer
15 views

How do I get Search API to index rendered content including referenced nodes?

We are building av website in Drupal 8 where the content is divided into 3 content types; Basic Page, the scaffold for all visual pages like "About, Features etc." Content Block 1, for a layout ...
0
votes
2answers
31 views

Whats best practice to show a node's fields in different regions in Drupal 8?

In D7 we used to create a view for nodes, with each field having an own display. Each display creates a block to place in any region of the site. Now, Drupal 8 is all fancy and has quick edit. I ...