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

learn more… | top users | synonyms (1)

1
vote
0answers
23 views

Drush : Missing $settings['hash_salt'] in settings.php

I just setup a new Drupal environment with Mamp. I can access my website just fine, but whenever I want to run drush cr I get the following error : exception 'RuntimeException' with message 'Missing ...
0
votes
1answer
18 views

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 ...
0
votes
1answer
12 views

Use Plugin Field inside buildForm()

In Drupal 8, I use this code inside my buildForm() method: $form['medias']['file'] = array( '#title' => t('Image'), '#type' => 'managed_file', '#upload_location' => ...
1
vote
1answer
23 views

Embed a collection of form inside a form

With Symfony2 I can embed a collection of form inside an another form (subform inside form). http://symfony.com/doc/current/cookbook/form/form_collections.html I would like know if it's possible ...
0
votes
2answers
36 views

Embed view into specific node

I try to embed a view into a specific node. I found tutorials for doing this with Drupal 7 and PHP-Templates: <?php print views_embed_view('view_name'); ?> But I look for a way in Drupal 8 ...
0
votes
0answers
37 views

Drupal 8 namespace overview [closed]

If I look at the "example" module for Drupal 8 , I can see a lot of namespace lines. For example, in field_example module i find <?php use Drupal\Core\Field\FieldItemBase; use ...
-2
votes
2answers
26 views

How install a module without break the installation if error

When I install my module, I get the following error: Declaration of Drupal\media_gallery\Form\GalleryForm::create() must be compatible with ...
-1
votes
1answer
47 views

Problem with a query

On Drupal 8, I have this line inside my form (my_module/src/Form/MyCustomForm.php). $users = db_query('SELECT * FROM {users}'); var_dump($users) shows an object (of my query) and not the list of ...
0
votes
3answers
46 views

create a taxonomy and attach a field to it programatically

how can i attach a field to an entity (vocabulary) programatically in drupal 8 I created a vocabulary $vocab = entity_create('taxonomy_vocabulary', array( 'name' => 'vocab_name', ...
1
vote
1answer
36 views

How do I apply check_markup() as Twig filter?

I am trying to modify output in my twig file. In D7, I was able modify data in my array with this check_markup($tweet->text, 'full_html'); and I see that this function still exists in D8. ...
0
votes
1answer
58 views

Implementing CKeditor's plugin in Drupal 8

I need to add the Templates plugin into Drupal8 CKeditor. So far it is available on the editor configuration page, but not on a node edit page. The code: namespace ...
0
votes
3answers
30 views

Prevent caching of a node

I'm working on facebook like button for drupal 8. It's about to be done, but I've faced a trouble. Whenever I change the configuration of my module, I still need to clear all caches manually for the ...
0
votes
1answer
35 views

How to create a custom handler in view?

I am trying to alter a field's argument handler. But It is showing me broken/missing handler in views. I have tried it both ways : $data[$table_name][$field_col]['argument']['id'] = 'MyClassName'; // ...
0
votes
2answers
48 views

How we replace goto with http status in drupal 8

In Drupal 7, I have using the following code: function my_goto($path) { $HTTP_status = 301; drupal_goto($path, array(), $HTTP_status); } How could I set the status in the goto?
0
votes
1answer
30 views

Generating internal URL/redirect by path>

In the past I could set up redirects with drupal_goto using a simple path (i.e., node/1). Is this not possible at all in Drupal 8? Everything I've seen relies on a route name but that requires either ...
2
votes
3answers
47 views

Equivalent of search_data() in Drupal 8

Is there any function equivalent to the (D7) search_data() in Drupal 8? I would like to get the search results as a renderable array or html for a given keyword programatically. In D8, the ...
0
votes
0answers
27 views

Drupal 8: HTML isn't rendering, HTML tags are being printed

I added a view template (views-view-fields--nieuws--page.html.twig) to my theme. The template is correct, when I edit it I see the results on my website. {% for field in fields %} {{ ...
0
votes
0answers
25 views

How can I get image url in a views field, D8

The D8 Views image formatter has only one option: Image. I would like to get the url that's in the markup, not the markup, in my views field output. Do I need to make a custom formatter, or is there ...
1
vote
1answer
26 views

drupal_render() and formBuilder's getForm

What exactly is the best way to accomplish this? I can pass the $form object returned from getForm to drupal_render() and get the correct themed output fragment but the API docs say this function will ...
0
votes
0answers
26 views

Drupal 8 multilingual node edit

I have a multilingual setup, and the content translation works well and smooth. But when I try to edit a node on the other language - I have the same link from the content admin menu, which renders ...
0
votes
1answer
38 views

Basic “empty” entity type?

Is there a module that provides an empty entity, to which I can add my own fields. I guess it would include just an Entity-ID as a primary field, and work with other entity modules. For me, nodes ...
0
votes
1answer
28 views

Redundant Title not required? [closed]

I don't know what to do with a redundant node Title. In Drupal 8, I've created an Author content type which includes fields for (a) First name (b) Last name (c) Biography. I can't seem to: Set it ...
0
votes
0answers
19 views

Override image-formatter.html.twig

I'm looking for an option to override the image-formatter.html.twig template in my own theme. But in the HTML page output (twig debug is set to true) there's no option listed to override the formatter ...
0
votes
2answers
45 views

D8: Best practice: Linking content types

I would appreciate suggestion for this common scenario in Drupal 8, which may be different to how I do it in Drupal 6. I don't want to do any programming. I have two content types: (1) Articles ...
1
vote
2answers
106 views

Getting the image URL from a field_image on a node

So I have this Node: object(Drupal\node\Entity\Node)[1862] protected 'values' => array (size=17) 'vid' => array (size=1) 'x-default' => string '7' (length=1) ...
0
votes
0answers
27 views

How to disable Toolbar on certain pages / theme?

Before deprecation of hook_page_build/hook_page_build_alter() we used good old method: $page['page_top']['toolbar']['#access'] = FALSE; (Source) It disabled Toolbar for specific route in specific ...
1
vote
1answer
81 views

How to create menu link in Drupal 8 with external URL

With my module MYMODULE I would like to create external link and place it into main menu. Is it possible to do that in MYMODULE.links.menu.yml file or MYMODULE.routing.yml? Something like this??? ...
0
votes
0answers
34 views

Is there a way to retrieve DRUPAL TWIG template's with core drupal 8 javascript functions like twig.js?

Is there a way to get precompiled twig templates from drupal 8 ? Example : Drupal.getTemplate('my-template.twig')(data); Thanks.
0
votes
2answers
42 views

Get field widget settings

In Drupal 7 they can be found in object that is returned by field_info_instance(). Is there a way to get widget settings for certain field name and bundle in Drupal 8?
0
votes
0answers
44 views

How to access update.php in Drupal 8 using nginx?

I would like to use Drupal 8 (beta) with nginx. It works correctly, except update.php . It doesn't find it. After analysing .htaccess (which is not processed by nginx) I realized, that there is no ...
0
votes
1answer
43 views

Using entity form display modes

I have created a custom form display mode my_mode for nodes and wish to display node form using this mode instead of default one at a custom page. How can I do it? ...
3
votes
1answer
105 views

How do you pass more than one node to a drupal 8 route?

I am working on converting a drupal 7 site to drupal 8 for some practice with 8. In my drupal 7 site, I have a custom hook_menu declaration with the following: function solution_menu() { $items = ...
1
vote
1answer
59 views

will drupal 8 twig have inheritance like the old template engine?

Drupal 7 you can style down to the fields on the page will we have this type of control with twig? I have reviewed a lot of documents about twig and didn't see anything that lets you have that same ...
1
vote
2answers
61 views

How to redirect (like D7's drupal_goto) to an external url in Drupal 8?

Drupal 7 has drupal_goto() that would allow redirecting to an external url. The change record indicated that ControllerBase::redirect is the method to be called in D8. ...
0
votes
1answer
28 views

Add content to same page drupal 8

I got a drupal 8 home page wich works fine but all my content on that page is in the same textbox like this image here: How can I make it so I can seperate this content and still show it under each ...
0
votes
2answers
141 views

Override field template (twig)

I try to override a fields template with my own one. The field is called field_test so I created a twig file with the name field--field-test--mynodetype.html.twig in root-theme-directory/templates/. ...
2
votes
2answers
125 views

How to add a project to drupal 8

How do I add a Drupal 8 project (Panels) to my drupal 8 site? I cant find it at the moment and no one got this problem before on google. Does someone have a idea?
1
vote
1answer
79 views

How to render a template in Drupal 8

I am trying to render a template in Drupal 8. In Drupal 7, I would create a theme with hook_theme, make a templates directory in my module, drop the template file in and I could display it with ...
0
votes
1answer
38 views

Unable to create a menu link with Drupal 8

I am trying to create a menu link in Drupal 8. I am following this document: https://api.drupal.org/api/drupal/core!includes!menu.inc/group/menu/8 My module name is twitter_pull and I was able to ...
1
vote
2answers
54 views

Drupal 8 set homepage template

How do I change the Drupal 8 home-page template, so it uses a different template from the regular page.html.twig template?
1
vote
1answer
30 views

Generating Url for a route

I want to use drupal l() function, but Url doesn't work really well with a view with optional argument. The view has a context filter, but it is optional. In the routes table it has path ...
1
vote
0answers
19 views

Manual setup of user's language

I need to switch user's language programmatically. The issue is I don't want it as an url part, and unable to switch it even with the regular language switcher block. What I've try: ...
0
votes
1answer
41 views

Running drush from a minimal shell

My goal is to pipe mail with Postfix into a drush command. I made a simple bash script that redirects stdin to the drush command, and I configured Postfix to pipe mail to the script. But executing ...
4
votes
2answers
57 views

How do I in code add new field values to a D8 content entity?

How do I in code, create a new field value, add it to a content entity, and then have it saved to the DB? Field API is dead. Long live Entity Field API! clearly shows how to read values, but doesn't ...
0
votes
1answer
31 views

Equivalent of file_transfer()?

I am porting a Drupal 7 module to Drupal 8; it has a call to file_transfer($uri, $headers). What's the equivalent Drupal 8 code for this?
0
votes
1answer
72 views

Why after installing Drupal 8 all links to the front page generates 404 error? [closed]

After installing Drupal 8 I get access to the front page but all links generate a 404 error. Why clicking on any links gives 404 error: http://localhost/drupal8/ while everything works fine with: ...
1
vote
2answers
36 views

Writing functional tests for a controller that makes call to external service?

I'm working on the D8 version of the CAS module. To integrate with a single sign on CAS server, this module will have to redirect the user to the CAS server often, and occasionally make cURL requests ...
2
votes
1answer
41 views

Web services for specific node

I know you can enable Web services for content in Drupal8. You also need to set permissions to make a GET request to content. But I was wondering if it's possible to set for each node if it can be ...
0
votes
1answer
36 views

How can enable multiple contact form in drupal 8?

I want multiple contact forms(different fields) in my drupal 8 site Like Webform module drupal 7. I have tried to add multiple contact forms and i am able to number of contact forms with different ...
-4
votes
1answer
89 views

Why Twig and not Blade in Drupal 8? [closed]

I was lately asked the question why Drupal 8 uses Twig as templating engine and not Blade, which is used in Laravel. I couldn't answer the question. But is there a specific reason why Drupal 8 uses ...