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

Showing email field in Drupal 8 Manage Display settings

On the manage display settings for Users there doesn't seem to be an email field. Is there a special setting that needs to be set to have the email field displayed here?
0
votes
0answers
10 views

How to setup Inline Editing with Drupal 8

I'm using a stock version of Drupal 8.1 and trying to figure out how to setup the quick edit inline module. I just want to be able to edit the fields on the fly without having to goto the edit page. I ...
0
votes
0answers
4 views

How do I write a custom migrate destination plugin in for a node type?

I've got a node type in Drupal 8 that uses field collections (from the module of the same name). The Field Collections module doesn't yet have a working migration destination plugin, so what I'd like ...
1
vote
1answer
11 views

How do service tags work?

In the user.services.yml, it defines a theme negotiator service as such: theme.negotiator.admin_theme: class: Drupal\user\Theme\AdminNegotiator arguments: ['@current_user', '@config.factory'...
0
votes
1answer
17 views

Using Zurb Foundation without installing the required dependencies: npm, gulp, bower, etc

I just created a sub theme for zurb foundation 6 on drupal 8, and reading the docs it tells me to do a npm install and a npm bower When doing a npm install I get the following errors: I fixed that ...
0
votes
0answers
12 views

Cloned Seven/Bartik themes don't show up

I copied bartik and seven theme from core/theme folder into the /theme folder. I renamed both into xbartik and xseven. I renamed all the files named bartik to xbartik and seven to xseven. I did a ...
0
votes
0answers
10 views

Adding a block where an admin can create users on the fly

What methods are there for creating users on the fly for Drupal 8 in a block? I'm creating a page where the admin can create content, but also there is a user reference field. I currently have it ...
0
votes
0answers
11 views

token_filter module: [node:nid] for custom block?

Drupal: 8.1.7 Module: token_filter 8.x-1.0-beta1 I have a custom block with a Text format that has Global and entity tokens are replaced with their values enabled. The custom block has this value: ...
0
votes
1answer
9 views

Object of type stdClass cannot be printed when received JSON response

I have: $result = $client->request('POST', 'http://'.$core_address.':'.$core_port.$core_uri, [ 'body' => json_encode([ 'a' => $a, 'b' => $value['v'], 'x' => ...
0
votes
1answer
19 views

Page manager (or panels) override path

I want to override Drupal 8 paths (routes) like node/{node} or taxonomy/term/{taxonomy_term} with custom panels variants. Is it possible?
0
votes
0answers
13 views

Why i received: Client error: `URL` resulted in a `405 METHOD NOT ALLOWED`

I have: $client = \Drupal::service('http_client'); $result = $client->post('http://'.$core_address.':'.$core_port.'/path', [ //'timeout' => 120, 'body' => json_encode([ 'a' =&...
1
vote
3answers
26 views

Programmatically change redirect after logout

I'm actually looking for a solution in Drupal 8 to change the redirection destination after visiting /user/logout page. I want to redirect the user on /user/login instead of home page. Try this but ...
0
votes
0answers
19 views

what to learn D7 or D8? [on hold]

It is 27th of july 2016 and drupal 8 has already been released. I am totally new to drupal and i am planning to learn theming and module development so some one please guide me , should i learn drupal ...
0
votes
0answers
20 views

Existing image field is not appearing in views

I am having a trouble with displaying existing image field of article content type in views. It's not coming while adding a field in views to display. I am using drupal-8.1.x, also I have tried to ...
0
votes
1answer
19 views

How to get a module hook_update_N current count in database?

We have a "MyModule" module, which has a mymodule.install. Inside the file, there is mymodule_update_8001, 8002 ... etc. How can I tell programmatically that on which version the module has at the ...
1
vote
1answer
31 views

Routing and path aliases

I have created a module with its routing.yml file. mymodule.dossier: path: '/dossiers/{node}/dossier' defaults: _entity_view: 'node.dossier_dossier' requirements: _permission: 'access ...
0
votes
0answers
25 views

How do I restrict access to forum? [on hold]

How do I give restrict access to forum? I am using the Content Access and the ACL modules, and they work fine for individual node/forum topic, but I need this for forum, as the Forum access module ...
0
votes
1answer
27 views

CkEditor configuration changes not being applied

I have made changes to the configuration of CKEditor for the basic_html rule set as follows: When I then try to use the editor, however, I get the following: I have tried clearing the cache ...
0
votes
1answer
29 views

What does #optional mean for a “details” form element?

The node edit form contains the following form element. $form['revision_information'] = array( '#type' => 'details', '#group' => 'advanced', '#title' => t('Revision information'...
0
votes
1answer
14 views

CKEditor and site style

I wish to enforce a site-wide set of styles to content produced via CKEditor. For example, if someone inserts a table, I want the class 'myclass' automatically added as follows: <table class='...
0
votes
1answer
28 views

Different landing pages for different countries

How can I get Drupal 8 to use different landing pages for different countries? I can create the pages but how do I tell Drupal which page to show for each country? Is geo location the only way, or is ...
2
votes
0answers
20 views

Is it possible to add a button to a field_collection?

I've created a custom entity module, and the form for it uses field_collections. The only form field I've defined programmatically is the title, the rest of the fields and field collections for this ...
-4
votes
0answers
25 views

Display SQL Table Data In Node

I need to retrieve data from a custom remote database (the database is already registered in settings.php and I have successful built entire dynamic pages that retrieve data with modules (routing etc.)...
0
votes
0answers
16 views

How can I translate or add words that seems not to be part of core strings? [duplicate]

I currently use formatPlural() to translate comment (not comments) and return its value to the Twig template. \Drupal::translation()->formatPlural('', '1 comment', '@count comments'); Is there ...
0
votes
0answers
29 views

Render values directly in a twig paragraph template

I'm working with the paragraph module and I've created a paragraph type called Image Teaser Block wich is an entity reference to a content type (Image Teaser, multiple references possible). This ...
3
votes
0answers
27 views

Prevent dual submit on form submission

I've got a form that submits via AJAX and in the callback I need to rebuild certain parts of the page to reflect the newly submitted data. One of these parts is the form, which I need to clear all ...
1
vote
0answers
18 views

Can the BaseFieldOverride class be used to implement hook_entity_bundle_info()?

I need to implement hook_entity_bundle_info(), and I noticed that the documentation includes a link to Finalize API for creating, overriding, and altering code-defined bundle fields. In short, that ...
0
votes
0answers
27 views

Why is the method attribute removed from <form>?

I work on submitting form via Drupal's Mail API. I want to pass all data with POST method. While I add this parameter to my form it disappear after rendering. Before rendering: <form method="post"...
1
vote
1answer
30 views

Change 'Log in', 'Log out', 'My account' menu text

Is there a way that the default text in the account menu can be changed within the theme?
0
votes
2answers
18 views

Proper way to create image field in a content entity

My site allows users to upload images and add title and description to it. So I make a new class which extends ContentEntityBase. In its baseFieldDefinitions() method, I put an image field beside ...
1
vote
1answer
20 views

How do I programmatically check if a context is active?

How do I see which contexts are active on the page? I can't find any ContextManager object in hook_preprocess_page().
0
votes
1answer
25 views

Entity 'changed' column doesn't change upon save

I have a custom entity called "release". Release has "state" and "building percentage" fields, which values may change during the release process. In both "setState" and "setPercentage" entity ...
0
votes
2answers
34 views

Packing taxonomy fields into one div not from SQL?

I created 2 taxonomy entity-reference fields. One is Categories and one is Tags. Actually I have some more taxonomy fields created. In nodes, some of these taxonomy fields appear one above the other. ...
0
votes
1answer
26 views

How do I correctly cache a themed menu output?

In mytheme_preprocess_menu(), I am altering the main menu: function mytheme_preprocess_menu(&$variables, $hook) { $node = \Drupal::routeMatch()->getParameter('node'); if ('menu__main' == $...
3
votes
1answer
70 views

How to increment variable in twig file?

I'm using a view grid template and a views-view-fields--view-machine-name.html.twig template in order to render some pictures in grid format. I want to assign dynamic CSS classes to every picture ...
0
votes
2answers
38 views

How to add custom class on the menu block using twig?

I'm new in Drupal 8 and i'm trying to display my primary menu block using twig as below {% if page.primary_menu %} {{ page.primary_menu }} {% endif %} which gives me like this <ul class="...
0
votes
0answers
13 views

AJAX error when using a custom ViewsFilter?

I have created a custom field that is a collection of a couple things, one being a taxonomy entity reference. Now I want to be able to filter a view based on this taxonomy reference. With the code ...
0
votes
1answer
27 views

Add file field with Form API

I'm writing a block plugin that uses the form API to allow users to edit its settings, and then output them into a template. I'm currently using <?php /** * @file * Contains \Drupal\my_plugins\...
0
votes
1answer
48 views

How to upgrade a site using Organic groups to D8? [on hold]

Assume a Drupal 7 site using Organic Groups (OG), which is to be recreated in Drupal 8, with the typical facilities that OG offers. For Drupal 8, apart from the initial port available on GitHub, ...
0
votes
1answer
29 views

Writing a LEFT JOIN

I have the following raw SQL: SELECT * FROM node_field_data n LEFT JOIN book b ON n.nid=b.nid WHERE n.type IN ('book') AND (b.has_children != 1 OR b.nid IS NULL) I have a module that I need to ...
0
votes
2answers
27 views

Adding constraints to a content type

I would like to create validation for a several fields on a content type to check if they each have unique values from each other. The part I'm struggling with is how to add the constraint for just my ...
1
vote
1answer
39 views

hook_form_alter() does not work for the contact form?

I have contact form module enabled from core drupal 8 modules. When I use the below code it has $form['field_consumer_name']['widget'][0]['#title'] = 'Individual Name'; I want that this code ...
0
votes
1answer
53 views

How to delete a custom field type and its data while uninstalling a module? [on hold]

Which function can I use in Drupal 8 to delete a content type's custom field type and its data while uninstalling a module? I tried this in hook_uninstall(), but it doesn't allow me to delete the ...
0
votes
2answers
42 views

Why is my javascript not being executed?

I have a Drupal 8 form and I'm applying some custom javascript to it. I've added a JS file, and a libraries file for my module containing a reference to it, but the code doesn't run. in module_name/...
0
votes
0answers
20 views

How to create an ajax auto-refresh table?

My current situation: I have an entity list builder for my own custom entity type. I need to make this rendered table to refresh himself (the whole table) each X seconds (5 maybe). How could I ...
0
votes
1answer
27 views

When I upload an image in drupal 8 the preview image is shown broken

My settings are, allow_insecure_derivatives: true suppress_itok_output: false editing the itok token for the image src works at the browser level. Do anyone know wha causes the issue and fix?
1
vote
2answers
165 views

Building a contact form from scratch

Is there a way to force Drupal not to base any contact form on the native Personal contact form that comes with it, and thus freely creating contact forms from scratch as done with Webform in Drupal 7?...
0
votes
2answers
19 views

Create content after editing other content-type

I have a certain content-type B with an entity reference to items of content-type A. I'm trying to programmatically create a content-type B node when a bool field in content-type A is set to true, ...
1
vote
1answer
24 views

How to get each field value in views-views-unformatted--view-machine-name.html.twig?

I have an twig file: views-view-unformatted--view-machine-name.html.twig {# /** * @file * Default theme implementation to display a view of unformatted rows. * * Available variables: * - title: ...
1
vote
1answer
23 views

Adding a new separate menu link to /admin/config in page?

Adding new separate menu link in admin config page like development service