Drupal 8 is the version of Drupal currently in development which will be the next major release. 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
12 views

Deploying to live and available modules

In Drupal 8 you can export configuration and move that to a production server. In core.extensions.yml there is an exported list of the enabled modules. If on development I have devel and other ...
0
votes
0answers
13 views

How can I made a field of “Content: Type” visible to users who do not have the “Administer content types” permission?

I am trying to create a view which shows new posts of certain content types, including the name of the content type. So, e.g., "New How To: Displaying Content Type Fields in Views". Here are the ...
0
votes
0answers
22 views

What are dependencies in the context of a user role in Drupal 8?

In the process of wrapping my head around Drupal 8's configuration system (which is awesome, by the way), I came across this: YAML file (from ...
1
vote
0answers
20 views

Drupal 8 Access Denied on every page

I've been trying out Drupal 8 on localhost which has been great, and I've now transferred it to a server, but every page has the Access Denied message. I can't even access the homepage, or user login ...
0
votes
4answers
40 views

How can I display block programatically in Drupal 8

I'm developing a site using Drupal 8 beta-14. I've created a view block of different terms and now I want to display it using code. How can I display it programatically? I used to do it in Drupal 7 ...
0
votes
0answers
13 views

How Do filters work in the analytics module?

I am trying to give authors the ability to access analytics reports for only the pages they have authored. So I am trying to write a filter for it but any filter I add removes the Authorization ...
0
votes
0answers
28 views

8 - Firefox loads JS before CSS, causing flash of unstyled content

My Drupal 8 site will load fine in Chrome and IE, because they both load my CSS before my JS when I look at the Network tab in the console. But when on Firefox, it will load the JS before the CSS. ...
0
votes
1answer
19 views

How to enable tokens for custom entity?

I had the impression that in Drupal 8 all entity tokens are provided automatically since it uses the new field structure but I don't see anything available for my entity. Do I need to enable ...
1
vote
1answer
24 views

Views escapes HTML tags in node body

I'm creating a view that displays a few fields from a specific content type. Among the fields is the trimmed nody body. The problem is that the HTML tags in the body are escaped and are visible as ...
1
vote
1answer
27 views

How can I distinguish the first image in an image field in a Twig template?

I have a custom field formatter for an image field. The Twig template for the image field is the following: {% for item in items %} {{ item.content }} {% endfor %} Each image is then formatted by ...
2
votes
1answer
29 views

How can I only show the first image of an image field in the teaser?

I have a content type with an image field that can contain an unlimited number of images. The field is used to display an image gallery in the full node view, but I also want to use the first image of ...
0
votes
0answers
16 views

How to prevent invalid config from being saved?

I want the site email address to be located at the same domain as the website. If an email address with different domain is provided such value should not be saved into config. I have taken care of ...
0
votes
1answer
17 views

Are 'active' and 'staging' required in config_directories?

Is it OK to delete the 'active' and 'staging' entries automatically created in settings.php? I don't plan on using them, but it's not clear to me whether some process might expect them to exist.
0
votes
0answers
14 views

Remove filter from a view id another filter has a value

In D8 I am trying to remove a filter from a view in case another has a value. I am able to remove it in hook_views_pre_build(): function MODULE_views_pre_build(ViewExecutable $view) { ...
0
votes
1answer
29 views

Drupal 8 configuration export/import not working for taxonomy terms

I did a drush config-export staging on a local version of my site then a drush config-import staging on the server. It imported all the taxonomy vocabulary but no terms. I also tried it via the UI ...
1
vote
1answer
25 views

“skip_process_on_empty” plugin does not exist

I'm trying to migrate entities from a D7 to a D8 site using this tut: http://www.metaltoad.com/blog/migrating-taxonomy-drupal-7-to-drupal-8 When I execute the migration I get the error: The ...
2
votes
2answers
62 views

How do I access field data in Twig?

I have a list field for a custom block type that looks like this: left|Align left right|Align right I can access the key in Twig by doing something like this: {% block content %} {{ ...
0
votes
1answer
19 views

how acces admin theme without /admin in url?

I try to have an admin theme for admin user and custom theme for user logged in without /admin/.... in the url. I create an entity content module, the routing is like that : # AnnonceEntity ...
0
votes
1answer
26 views

Private Content in Drupal 8

I'm currently trying out Drupal 8, but I'm wondering what is the best way to make some content (content types and some specific nodes) only available to authenticated users? I'm using 2 content ...
0
votes
1answer
27 views

Can someone explain the @RestResource annotation for building a Rest resource?

I am trying to create a RESTful web service. Above the class there is a comment/annotation /** * Represents entities as resources. * * @RestResource( * id = "entity", * label = ...
0
votes
1answer
40 views

Drupal 8 REST - POST json data denormalization error

I created rest resource plugin in a custom module and need to send some JSON data with the request, and access it in the post function. At the moment my post function does not do anything but return ...
-2
votes
5answers
139 views

Should I learn Drupal 7 or 8? [duplicate]

I know this has been asked many times before, but I have searched and can't find any mention of it in the past 6 months. My background is in Excel/VBA building complex spreadsheets, userforms, etc. ...
0
votes
1answer
20 views

Block layout - List of all blocks

I'm having a question about the Block layout in Drupal 8. A couple of months ago (I don't know which beta it was) the block layout looked like this: As you can see there's a list of blocks at the ...
0
votes
1answer
11 views

Web Services - GET Request Article (HAL+JSON)

I'm trying to make a GET request to a specific article on my drupal 8 website (local). These are the steps I've done: Enabled all 4 Web Services modules at the modules page Created an article (url: ...
3
votes
1answer
82 views

How to get the nid for a newly created node?

If I've created a node in an install hook, how can I immediately get a reference to the nid property? It doesn't appear to be set on the entity during save. use Drupal\node\Entity\Node; function ...
0
votes
0answers
28 views

Password migration from Drupal 7 to Drupal 8

I know that from Drupal 6 to 8 we needed to make the MD5 hash on migration, but I thought that from 7 to 8 it wasn't going to need any changes. D8 Migrate examples doesn't mention anything about ...
1
vote
2answers
42 views

Get proper block title from block object

I have a block object in drupal 8 that I am trying to get the title of. I tried $block->label() and it seems to work for some block types, but not for Views blocks. On those, it returns the block's ...
0
votes
1answer
32 views

How do I prevent a page from reloading after form submit?

Im trying to edit the poll module to prevent the page reloading after every form submit. no matter where I put $form_state->disableRedirect() when the button is clicked the whole page reloads. ...
0
votes
1answer
43 views

Drupal 8 Rest: what is the best place to look for up to date working examples? [on hold]

REST in D8 seems to be a moving target over the last months, so an example from some months or even weeks may be not working exactly the same way. What is the best place to check how to make at least ...
0
votes
1answer
36 views

How do I keep unique form id for ajaxified form?

I have a form(which is extending the FormBase class) that requires entity as argument(but I am not manipulating with this entity so that's why I am not using the EntityForm which is irrelevant to this ...
1
vote
0answers
41 views

Drush v8: drush sql-sync failing with Illegal string offset 'site' backend.inc:1030

I'm using Drupal 8. I have an installation on my local dev machine as well as one on my remote demo machine. I'm attempting to use drush sql-sync so that I can make sure my local dev has the same data ...
0
votes
0answers
18 views

How do I reload block content and make sure all JS fires properly?

I have a block and I want to reload its content when some conditions are met via JS. Currently I do not have any libraries attached to it but I am wondering that, in case there are some javascript ...
0
votes
1answer
36 views

MODULE_preprocess_block() get rendered region in drupal 8

So I am trying to port a Drupal 7 module to Drupal 8, and am struggling with how to translate a "NAME_preprocess_block" method. In the D7 code, it filters by the region a block is getting rendered ...
0
votes
1answer
35 views

When to use BaseFieldDefinition instead of hook_schema

While creating a new information for Drupal 8, I came across 2 approaches to create a new column on the entity table on database: * use hook_schema() (as I was used on Drupal 7) ...
0
votes
1answer
34 views

How can I use different database backend for certain tables?

What do I need to do in order to serve config entities from Mongo and cache from Redis database backends? So basically: a) how do I tell Drupal that I want to use different db backend for certain ...
1
vote
1answer
29 views

Overriding field.html.twig in my module

I'm writing a field formatter and I need to override the default field formatting. I've already implemented themes for the items itself, but I can't get my theme to work for the field container. I've ...
0
votes
1answer
51 views

How do I add a variable for a Twig template in my preprocess function?

I'm using the following code to preprocess the variables for my template: function template_preprocess_imagegallery_format(&$vars) { template_preprocess_image_formatter($vars); ...
1
vote
1answer
33 views

How can I theme an image inside a field formatter

I'm trying to change the output of an image field so that I can display it using a Javascript image gallery. I have the basic field formatter set up, but I'm having trouble finding the correct place ...
0
votes
1answer
15 views

Entity operations and redirect destination (using EntityListBuilder)

I have an entity collection page that's built with my own subclass of EntityListBuilder. My problem is that the operations links do not set a redirect destination, so after clicking e.g. on an edit ...
0
votes
1answer
25 views

How do I remove the site name from the head title in drupal 8?

The <title> element in the <head> of every page currently has the form page_name | site_name. I would like to make this have the page name only site wide. I've found advice about how to do ...
0
votes
1answer
52 views

Drupal 8 REST Post creating entities with relations

I am having trouble creating comments on nodes ( articles etc. ) with the Rest module. I have enabled the endpoint in rest.settings.yml : resources: 'entity:node': GET: ...
0
votes
1answer
22 views

drupal 8-b14: access img-alt attribute in field-template

Hy, I have copied the field.html.twig Template to field--node--field-image--article.html.twig, to specialize the template for my needs. In this case the template would be called for content type ...
0
votes
0answers
13 views

How to define fallback libraries?

In case I use libraries from external sources, like getting jQuery from CDN instead of using the local file, how can I handle cases when the external file doesn't load? Does Drupal have a feature for ...
1
vote
0answers
32 views

Form API multiplie file upload validation error

I have a simple form with a multiple file upload field. I am trying to validate the documents against extensions and file size. The validation seems to work, but now if I don't select any file (field ...
0
votes
0answers
27 views

How to upload files to be linked to in a text field

When editing a page, we would like to be able to say "Add file", upload a file and then link to it in the Text. Or mark some Text, say "Link" and choose from the media library. (Like it is out of the ...
0
votes
1answer
36 views

file_save_upload validate file size

I have a simple Drupal 8 form where users can upload a picture. The issue is that the upload_max_filesize is set to 2M on the server. So if I upload a bigger file, the form submission fails: ...
0
votes
2answers
34 views

Drupal 8: Template suggestion for form-element in a views exposed filter is not working

In Drupal 8 I am trying to add in a suggestion via hook_theme_suggestions_alter() like so: function ua_sc_theme_theme_suggestions_alter(array &$suggestions, array $variables, $hook) { print ...
3
votes
1answer
87 views

What is the correct composer based core update workflow?

I want to use composer to manage Drupal 8 dependencies, but I'm not sure what is the right core update workflow. At the moment I'm using drush to update core to latest beta release, but I also have ...
1
vote
1answer
33 views

Is there a way to position my Article title in Drupal 8 teaser?

I have In teasers and other custom display types I would like the image to appear above the title. However, when I try to manage the display fields from the admin menu there is no way to change the ...
0
votes
0answers
26 views

How to display image preview right away for managed_file form element?

I have managed_file for uploading an image in my form and I would like to display the image(thumbnail) right away when the user uploads it so he won' have to submit the form to see it(I am rendering ...