Questions tagged [8]

Version tags should be used only for questions that apply to a version only, not to merely say what version a site is using.

1
vote
0answers
460 views

How to update jquery and jquery ui

I am on 8.3.3 and I would like to update jquery and jquery ui to the latest stable version of both. I do not want to update drupal core only jquery and jquery ui. Anyone knows how to do that?
0
votes
2answers
1k views

Attaching libraries to specific controllers

I want to include the google charts js library to a specific (or set of) controller(s). In my library file, gcharts.libraries.yml, I have the following: google_charts: remote: https://developers....
1
vote
0answers
114 views

Library .js file getting corrupted

I'm trying to get views slideshow to run on a Drupal 8 site. I've followed this tutorial and have downloaded the required libraries. I've set up the view, and it shows up fine on a page when it's ...
1
vote
1answer
409 views

What ways to attach a library to a form?

I created a custom form and I use a js library on it. I attached my JS in my template file but in a first time, I tried to attach it directly on my form with $form['#attached']['library'][] = "...
0
votes
1answer
629 views

How to add google_tag script to header with custom environment variables?

I'm trying to add Google Tag Manager to the <head> of my document. Unfortunately, the way I'm doing it with an HTML tag render element, the ampersands (&) are being escaped. function ...
1
vote
1answer
1k views

How to reuse object between Drupal Behaviors?

We have a JS file (basic-page.js) that has the following Drupal Behavior. In this, we created what we believe is considered a Drupal object (need help with correct term) that contains a function that ...
1
vote
1answer
119 views

Installing the Waypoints plugin

I’m using Drupal 8.5.4 and I have installed the Advanced CSS/JS Aggregation module. I’m trying to install the Waypoints plugin without success via the module: jQuery waypoints (still on alpha1 for D8)....
1
vote
1answer
175 views

How to load JS as the first item in head tag?

We have a custom module that has a JS library that we want to load in the <head> tag as the very first item even before all the normal Drupal JS files. All other libraries are loaded through ...
-1
votes
1answer
25 views

Load module config into Javascript from a different module

I have two Drupal modules. One is a shared module that provides a JavaScript library. The second is a module that builds a form which uses that library. Lets call them modlib and modform. They've ...
0
votes
0answers
46 views

Javascript not working for unauthenticated users

I have some script for a "back to top" button. The script works fine when I'm logged in, but it does not work when I'm logged out. I've read about dependencies, but I think I'm doing them correctly: ...
0
votes
0answers
14 views

How to add 3d party js library to the project?

For my D8 project I am doing some optimization for mobile devices, and for node views it is very important for us to implement hyphenation for the titles. Based on my research the css property hyphens:...
0
votes
1answer
17 views

Creating an image upload input field

I'm creating a image upload input field in blockForm which will output to Twig later. But got stuck due to some stuff. public function blockForm($form, FormStateInterface $form_state){ $form['...
2
votes
1answer
2k views

How do I extend a configuration form without using hook_form_alter()?

I want to extend some fields in a config form of a module with another module in Drupal 8. I created a config form in a module (e.g. custom_1) and now I want to add some more fields from another ...
-1
votes
1answer
30 views

Retrieving value of paragraph type with entity reference revision through preprocessor

I have created a paragraph type which has field of type entity reference, link, plain text. Now I want to fetch the values present in these through the preprocessor.paragraph.inc and display it in ...
1
vote
0answers
17 views

Use generated JWT from Keycloak to authenticate user in Drupal using REST API

We are working on developing a mobile app and users should be able to log in to the app and in our backend Drupal site authenticated from Keycloak. Our main goal is that the user would be able to ...
0
votes
0answers
14 views

How to show menu items depending on the user's roles and the node type?

I would like to show some menu items (merged with the main navigation menu) when viewing a node (full content) of a custom content type. Also, this menu items depend on user's roles. It could be ...
0
votes
1answer
53 views

Create the FooTable functionality by using only views

I noticed by using FooTable display on one of my view on a Drupal 8 site, it is increasing the load time of the view by more than 2000 ms. The main idea i am using Footable is because of the ability ...
3
votes
2answers
904 views

How do I get comments to be indexed?

I'm not sure if it's actually doing this; I can't see any options for comment fields in the configuration. How can I check? Does it say explicitly somewhere?
0
votes
2answers
139 views

Want to display the validation error message above the webform

I have a webform created in Drupal 8 using the webform module I have to submit the data to 2 different 3rd party API. The scenario is I have to submit the data to the 1st API if there is no error ...
-3
votes
0answers
15 views

Running Drupal 8 on AWS lambda [closed]

Is there anyway to run Drupal serverless? I search the web and the closest I can find is this site https://www.slideshare.net/AmazonWebServices/making-headless-drupal-serverless
0
votes
0answers
46 views

Passing variables between theme preprocess hooks

I'm a newbie to Drupal 8 and PHP coding in general so I hope my approach is not too much out of the lines. I'm trying to theme some parts of my website by fiddling a bit with templates, what I need to ...
0
votes
1answer
578 views

How to create a parent content type which consists of other child content types?

I want to create custom content type (parent) which consists of other custom content types (children). Is this feasible in Drupal 8? Or I should do it programmatically? Example: I want to have custom ...
0
votes
2answers
26 views

How to attach media item created during migration to media field in node

I am migrating content from Drupal 7 to Drupal 8. There is an audio field that I am currently moving to media via a custom process during migration. When I get the id of the new media created I can't ...
1
vote
2answers
650 views

Update website from 8.0.0 to 8.6.1

I'm pretty new to Drupal and I'm trying to update a website from 8.0.0 to 8.6.1. I've followed the guide here: https://www.drupal.org/docs/8/update/update-core-via-composer The composer part went ...
1
vote
1answer
277 views

How do I create a custom view filter for an existing field?

I ran into a problem with creating a custom view filter for an existing field for Drupal 8. I mean a filter not for fields like "nid", "title" and so on, but for fields, which were named CCK-fields ...
0
votes
0answers
43 views

Why isn't the access check being called at all?

I have the below code. I have set up the business logic and it works fine in a .module file, but not in an access controller. What am I doing wrong? // nodeaccess.routing.yml nodeaccess.people: ...
1
vote
1answer
548 views

RouteNotFoundException when trying to delete a custom entity

I am building a custom component in Drupal 8 that has an entity with child entities i.e., TeamEntity has one or more MeetEntity objects. When I navigate to the "Delete" link for a given MeetEntity, I ...
1
vote
2answers
71 views

How can I print the vocabulary name instead of the referenced term in a node template?

Let's say I have a content type article with a field "taxonomy". The vocabulary is "fruits". The terms are "apple", "orange", "bananas" The article belongs to "orange". I can easily print in my ...
4
votes
1answer
716 views

Send mail notification when node of given type gets created

Use case: a small site where I want to warn all users by mail whenever a new content of a particular type is created. I thought I would try Rules+Actions to handle this. I'm working on a vanilla ...
0
votes
1answer
595 views

Creating a layout with Page Manager

I'm trying to use Panels and Page Manager in Drupal 8. My current versions of each are: Page Manager: 8.x-1.0-alpha23+12-dev Panels: 8.x-3.0-beta4+41-dev My current problem is having no idea how to ...
-1
votes
1answer
58 views

Export/import users

I am looking for a way to export users from one Drupal 8 Site into another Drupal 8 site. Is it possible to do this by exporting and importing the Users tables? If so which ones? I see there are ...
0
votes
1answer
492 views

Ajax form an multi-select

I have a form which provides select2 when the select1 is changed. However I would like select2 to be a multi-select. I can't seem to get this to work. It populates a single select input just fine, but ...
0
votes
1answer
884 views

Drush does not work invoking the local Drush

I have installed new D8 on a remote server using this way https://github.com/drupal-composer/drupal-project . I have pulled files from GitHub and I have run 'composer install' for getting the all ...
0
votes
1answer
343 views

JavaScript files not loading

The JavaScript files for my theme aren't loading. What am I missing? My theme.info.yml: name: theme type: theme description: Custom theme. core: 8.x base theme: classy version: 8.x-1.0 libraries: -...
0
votes
0answers
26 views

custom webform time and date elements id's

Using webform, I have two "Date/time" elements with popup date and timepickers enabled. I have a jQuery script to calculate and display detailed time difference between the values (date and time) ...
2
votes
1answer
1k views

How can I allow users to specify image dimensions in CKEditor

I have a use case where content editors have a requirement to specify the height and the width of an image in the image properties. Sticking to styles is not possible because $reasons. The CKEditor ...
0
votes
1answer
32 views

Why isn't my controller returning AccessResult::forbidden()?

I'm working on a node access module. I've set up my logic. I can't seem to get my code to return AccessResult::forbidden(). I can't even get \dpm to run in access method. What am I doing wrong? Below ...
1
vote
1answer
499 views

Is there a way to trigger migration imports from the admin UI?

I want to use module WordPress Migrate to import content from WordPress into my new Drupal 8 website. I can use the module's button "+Add import from WordPress" appearing on page admin/structure/...
1
vote
1answer
12 views

How can I export Image Crop configuration with an Image Style for custom module?

I have a custom module I'm re-using on other projects and I want to include an image style with an image crop configuration. Under the configuration menu, I export a single crop item: langcode: en ...
2
votes
1answer
352 views

Third party library added via composer.json but how can I load it in a module now?

I have set up a module in my Drupal 8 project to handle some tasks I need doing using AWS. I added the awssdk (for PHP) to my composer.json and ran the composer update command successfully. the AWS ...
0
votes
1answer
630 views

domready is not defined

I'm building my own theme to be used with Angular 4 and can't tell where/why Drupal is deciding to import jQuery. Here's the code for my theme, loosely based off this Angular 1 theme: ng.info.yml ...
1
vote
0answers
32 views

How can I round up price matrix percentage to two decimals?

I'm looking for a way to round the percentage from Drupal 8 Commerce Shipping Price Matrix module to cents in USD. Is this possible? I found this function in the commerce_shipping_price_matrix/src/ ...
1
vote
2answers
523 views

How to reuses page--front.html.twig for multiple pages

I created a page--front.html.twig which allows me to create a distinctive front page. How would I go about reusing this page to create a landing page, a page with an identical layout the front page ...
1
vote
1answer
26 views

How to filter a node view on a paragraph field

I have a content type "Lunch" containing a paragraph type field named "Ingredients". This is a multiple values field which store a prapgraph type named "Ingedients" => Taxonomy term + Quantity LUNCH ...
2
votes
1answer
572 views

Add animation/fade to modal/dialogue box (without using the bootstrap)

The current state of a modal/dialog opening in Drupal 8 (and 7 for that matter) is pretty clunky from a user experience perspect. Leveraging some type of animation/fade would really enhance the ...
0
votes
1answer
512 views

How to filter a View by Year and Month with Summaries for each one

or How to remove the exception parameter of a View's contextual filter Hi, In Drupal 7 I have a View with two contextual filters (date field): /view-url/YEAR/MONTH When YEAR is the first argument ...
1
vote
1answer
27 views

How can I read config schema from a config entity?

I need to read the schema definition from a config entity, which is located in config/schema. For example the schema from a node type defined in node.schema.yml: node.type.*: type: config_entity ...
0
votes
1answer
553 views

Assign roles at registration

I am trying to assign a user role at registration using Webforms in Drupal 8. Is this possible or is there another form module that would do it better? I have two user roles 'Venue' and Artist' which ...
2
votes
1answer
481 views

How to print and/or manipulate individual image attributes and suppress width and height via the image.html.twig template

I had to get rid of the width and height attributes in my images and wanted to learn better the possibilites of Twig in Drupal.
1
vote
1answer
35 views

Passing an array stdClass Object from custom module to template

I’ve created some D8 custom modules which call rest API and and it’s working fine when I get simple array in my $response. In my controller, this is working : return [ '#theme' => '...