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
20 views

Working on Drupal 8 and drush with teammates

I'm currently working on a website using Drupal 8, with 3 other members in my team. We use git as a versioning system, and we very often work at the same time on different branches. Here is the ...
0
votes
0answers
9 views

Login by ajax on Drupal 8

I would like know is sommeone have a example of code for make a Ajax Drupal 8 query for login please. Thanks.
1
vote
1answer
30 views

Render views block inside twig template

I need to render a views block in my page.html.twig template. In D7 I would do this: <?php $block = module_invoke('module_name', 'block_view', 'block_delta'); print render($block['content']); ...
1
vote
1answer
17 views

How does one add a new base field to a content entity?

I'm currently porting my contributed module to Drupal 8, and sometimes I realize I've chosen the wrong field type. I also know that I will need to add additional fields later on, and it would be nice ...
1
vote
1answer
32 views

Are there Drupal 8 custom block type naming conventions?

With our ability to create custom block types and manually add additional fields in Drupal 8, is there a simple naming convention to create block--custom_block_type.html.twig to handle the layout of ...
0
votes
1answer
22 views

Install a custom empty module break my custom style

On Drupal 8, I have a style and a empty module : /modules/kyna/nature/ /modules/kyna/nature/nature.info.yml name: 'Nature Theme Structure and configuration' type: module description: 'Example ...
0
votes
1answer
32 views

Suggested theme hook doesn't get applied

The custom theme hook (abacus-product.html.twig) I've appended via a hook function doesn't get applied. But it shows up in the suggestions. <!-- THEME DEBUG --> <!-- THEME HOOK: 'page' ...
1
vote
2answers
35 views

How can I apply different templates based on taxonomy hierarchy?

I'm new to Drupal and I don't have extensive knowledge so I'm hoping I can get this question answered. I want the taxonomy pages of lower hierarchy to be displayed differently from the higher by ...
2
votes
1answer
35 views

What are the alternatives to Features module in Drupal 8

I am trying to export configurations from one Drupal site to other. This is not a one time operation, I will need to do this multiple times and Single Import, Simple Export is not an option as there ...
1
vote
1answer
29 views

What are cloned sites in Drupal 8?

When trying to export my site configurations from one Drupal 8 site to other I keep getting the following error The staged configuration cannot be imported, because it originates from a ...
5
votes
3answers
196 views

When should I use Backdrop CMS rather than Drupal?

From what I've heard, Backdrop is basically an alternative to Drupal 8. Is deciding which one to use simply a matter of preference and ideology, or are there specific use cases for each? If I'm ...
0
votes
0answers
13 views

How add SyntaxHighlighter addon to ckeditor

How I can add SyntaxHighlighter addon to CKEditor on Drupal 8 ?
0
votes
2answers
21 views

How can I deploy User interface translation in Drupal 8?

Strings that I translate at "User interface translation" /admin/config/regional/translate are not exportable by "Configuration management" /admin/config/development/configuration for me. Am I missing ...
1
vote
1answer
34 views

Message “Restricted HTML” on node/add page

On node/add page for any content type(Article, Basic page. Custom) message appearing "Restricted HTML" , not able to add content. What shall a do to resolve this problem?
0
votes
2answers
38 views

Create user in Drupal 8 but password not working [closed]

I tried to create user in Drupal8 using entity_create. The user is created just fine, but I can't login with the password unless I change it from the admin page. $authData['name'] = 'testuser'; ...
2
votes
1answer
26 views

Getting the number of Flood events within threshold?

The FloodInterface has 4 methods: register - which adds an event clear - which clears an event isAllowed - which checks to see if the number of logged events is greater than the threshold ...
1
vote
1answer
37 views

Is there any sensitive data in the Configuration Management Export?

I noticed in default.settings.php this comment: Location of the site configuration files. The $config_directories array specifies the location of file system directories used for ...
2
votes
1answer
39 views

Drupal 8 trying TDD with PHPUnit

I'm trying out the built in test driven development method in Drupal 8 but I'm running in to a problem.. I'm getting the following errors when trying to run ./core/vendor/bin/phpunit --list-groups ...
0
votes
1answer
62 views

Drupal 8: Read field value from $variables in preprocess_html

I've been wrestling with Drupal 8 for some time now and have run into a little problem. I want to get a field value from a content type that I can use in my html--front.html.twig. I can create a new ...
1
vote
1answer
47 views

How can I prevent a particular page being cached in Drupal 8

I have activated the cache on my Drupal 8 site, and of course all pages are cached as expected. However, I'd like to have a specific page bypass that cache. In my controller I built the page as ...
4
votes
1answer
71 views

How do you implement a breadcrumb in Drupal 8?

I've tried to define a new breadcrumb override, but I'm still getting the site default. I've created a custom module, foo_breadcrumb: - modules/custom/foo_breadcrumb - ...
2
votes
1answer
42 views

Drupal 8 Custom Templates

In Drupal 7 I have a web site with dozens of custom templates. I used the theme function to pass variables to my templates defined in hook_theme in a page callback defined in hook_menu. How do you do ...
0
votes
1answer
21 views

How to upload/insert images in content from module?

$article = entity_create('node', array( 'type' => 'article', 'title' => generate_demo_content('lorem_ipsum_title'), 'body' => array( 'value' => generate_an_article(), ...
0
votes
1answer
18 views

This form was missing from the server cache on Drupal 8

On my site I do this: I got a form with this field: 'myfile' => [ '#title' => $this->t('MyTitle'), '#type' => 'managed_file', '#upload_location' => 'public://myfolder', ], And ...
0
votes
1answer
26 views

CKEditor not displaying in latest 8.0.x-dev version

After updating Drupal from version 8.0.0-beta7 to version 8.0.x-dev — to fix text_format fields not submitting their value due to a missing name attribute —, my field is now displaying as a basic ...
2
votes
1answer
29 views

Can a Drupal 8 module install a content type optionally or conditionally?

I have a module which installs a number of different custom content types, each defined in a .yml file in config/install/. I install my module, and the content type appears and works normally, and I ...
0
votes
1answer
35 views

Store array values in schema field

I am creating a configuration entity for a module and in my config/schema.yml has as field as, mymodule.connection.* : type: config_entity label: SSO connection mapping: name: type: ...
1
vote
1answer
35 views

Drupal 8 - Routing multiple params / paths to single method

I'm attempting to create the following routing : /app/{type} /app/{type}.{format} /app/{type}/{limit} /app/{type}/{limit}.{format} I would like all of these routes to route to a single method. Do ...
0
votes
2answers
42 views

Share config on Drupal 8

I have this error when I try to import the config of an another site: The staged configuration cannot be imported, because it originates from a different site than this site. You can only ...
1
vote
2answers
50 views

Can not remove the Devel module

While doing an upgrade to the Devel-module something went terrible wrong. Decided to remove the module through the "Uninstall"-tab. The module is however not listed there, while it's marked as active ...
0
votes
0answers
32 views

Adding a list of strings or entities to another entity

I need to be able to add a list of departments to an entity directly via the add form of that entity. Those departments don't necessarily exist in the application beforehand and could be strings or ...
4
votes
3answers
643 views

Drupal 8 vs 7 performance comparison?

I am wondering if there are any reliable performance comparisons between vanilla D8 vs D7? I have searched the web but only find this which is far from encouraging.
0
votes
1answer
48 views

Converting entity to JSON

I am quite new to Drupal and Drupal 8 so forgive me if my questions seems rather naive. I have created a custom module that creates a custom content type. I am attempting to extract those entities ...
0
votes
1answer
27 views

setting up drush AFTER drupal multisite installed

new to drupal and even newer to drush. godaddy shared hosting, I manually setup drupal 8.x multisite where one site is the host account and the rest are subdomains to it. (I didn't use the cpanel ...
0
votes
1answer
39 views

How send a mail with attachment on Drupal 8

I try with this, but no success: $params = [ 'body' => 'My body', 'subject' => 'My subject', ]; // I check by debug this code and $file get the right file $file = File::load($myfile_id); ...
3
votes
1answer
86 views

Get url for every language on Drupal 8

I have a route of a page, ex: contact.site_page. I want get the link for it on every language of my site. On my site the contact page is: for English: /en/contact for Spanish: /es/contactenos I ...
1
vote
1answer
64 views

Inline Entity Form in Drupal 8 (create item while adding a reference)

I have a Family content type and a Person content type. A Family has an entity reference to one or more Persons. The normal workflow requires me to first create the Persons, then create the Family ...
1
vote
0answers
39 views

Drupal 8 cron not running from external source (as anonymous)

Running cron with crontab is not working on our Drupal 8 website if the user is anonymous. If I'm logged in as admin, I can run cron with the button or the url with key. If I'm not logged in, cron ...
0
votes
2answers
50 views

How not render a region on specific page programmatically on Drupal 8

I put a custom block (develop for me) on sidebar first region for every page, every fine, but I want that this block not render on the home page. On my module, I made this: funtion ...
0
votes
1answer
33 views

Custom Entity Not Showing in View Creation UI

I started learning Drupal 8 this week. I followed this guide to create a new entity, which I then made available through REST using the following tutorial: ...
0
votes
1answer
42 views

Drupal 8 Migration fails without any error

I'm trying to run a migration D7 to D8 which I've coded. This is the command: drush migrate-manifest manifest.yml --legacy-db-url=mysql://DrupalAdminUser:drp800sk@localhost/drupal7ddbb --verbose ...
1
vote
1answer
52 views

How can I enter a custom maintenance mode message for a non-English D8 site?

I am playing around with a D8 site (8.0.0-beta6) and having trouble locating where some of the controls have gone. During the initial installation procedure I selected a non-English localization ...
1
vote
1answer
46 views

How can I disable a troublesome module in D8?

I've been playing around with D8 and have managed to break a few things I can't figure out how to fix. Most recently, after installing (via manually adding the module code to the modules folder) the ...
2
votes
2answers
43 views

How to skip route if not user access

I have two routes (from views module) with path "/test". Route N1 required "role_1" user role, route N2 required "role_2" user role. Rote N1: class Symfony\Component\Routing\Route#9524 (9) { ...
1
vote
1answer
31 views

hook_page_attachments() not called from mytheme.theme file

I am trying to load an asset library in my Drupal 8 custom theme. I have created the library and can load it via mytheme.info.yml file. However, if I try the load it using hook_page_attachments() in ...
1
vote
1answer
78 views

Why can't I reinstall my module after uninstall?

With last beta version of Drupal 8, I have this error: Error message Unable to install Nature Theme - Structure and configuration, block.block.kyna_block_aboutus, ...
1
vote
1answer
46 views

Modify Drupal pagination to restrict shown page numbers on Drupal 8

On Drupal 8: I have a pagination for list of articles within a Drupal site e.g.: <<first <previous ... 3 4 5 6 7 8 9 10 11 ... next> last>> So at the moment there are always ...
3
votes
1answer
75 views

Drupal 8: How to properly add a settings widget to a node add/edit form and save the value?

So I reviewed the code in the core book, menu_ui, and path modules, and they all seem to handle adding a settings widget in a vertical tab differently. The book module uses a method called ...
6
votes
1answer
84 views

Programmatically get a form in Drupal 8

The documentation states: The argument passed to the getForm() method is the name of the class that defines your form and is an implementation of \Drupal\Core\Form\FormBuilderInterface. How ...
0
votes
1answer
49 views

Image field, how add title field?

Here drupal have a field for set a description for each images: How I can add a custom field for each image please ? By example a "Title" or "Author" field ? Thanks.