Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
15 views

How to provide checkbox for a grouping field?

For my Drupal 8 website I have created a view with a list of nodes. I have grouped the nodes based on the certain field. Additionally I would like to provide a possibility for the user to perform bulk ...
-3
votes
2answers
36 views

How to change the background color of blocks? [closed]

I just want to change the background color of a block on the “Sidebar First” region in Drupal 8. How can I do that?
0
votes
0answers
11 views

Custom Ajax forms with managed_file form element

We have a form with three fields - where depending on the value of the first select field, we will show the other two form elements - one select field (the options depends on the value of the first ...
0
votes
0answers
24 views

AccessCheckInterface's access method called several times per page load

I want to perform a custom access check for every page load. For this purpose I implement AccessCheckInterface and perform the checks in the access method. AccessCheckInterface has a method applies, ...
0
votes
1answer
24 views

How to send a custom Solr Distance Query with SearchApi

My nodes have a geofield and my search query should find all the nodes within a range. I've managed to create a search form against my Solr Server with views. But I want to do the request by myself (...
-3
votes
0answers
18 views

How to use “data-drupal-selector” in form element? [on hold]

Form element has attribute - data-drupal-selector. How to use it?
0
votes
1answer
24 views

is there an alternative for hook_views_ajax_data_alter in drupal 8?

As the title sais, is there a similar behavior like hook_views_ajax_data_alter in drupal 8 like in 7? If not has anyone achived the same result programatically? Thanks in advance.
0
votes
1answer
14 views

How to manage catalog display of images for Commerce 2 product variation

I have created a custom product type and its variations are created with attribute 'Size'. If I create a new product with its multiple images, then the catalog view shows these multiple images instead ...
-1
votes
1answer
23 views

Display an uploaded image in a webform, rather than the filename

Background: I'm using the profile module to hold user data but that makes an unpleasant UX for updating user info. So I'm using a single-page webform to offer the editable user data. The user data is ...
0
votes
0answers
14 views

Custom Views Exposed Filter for views

I Have a content Type 'Article' , which has below 2 fields 1.'Text List' field having 2 values 'Regional' or 'Country' (single selection radio button and Required Field) And 2.'Entity Reference' field ...
-1
votes
1answer
23 views

Alter serialized json output

Everytime a node is created, I have a Rules Action that serialized the data into json and send it to OneSignal. I have the below code that does it... $entity_id = $entity->id(); // Getting ...
0
votes
0answers
40 views

500 server error on cache flush [twig specifically]

I am getting a 500 error, The request timed out, The web server failed to respond within the specified time. This only happens if I flush all cache or flush twig cache, but not for css/js cache flush ...
0
votes
1answer
25 views

file name constraint in form

I've got a basic field constraint figured out (per question here: Validation constraints on form fields ignored ) Next, I want to constrain the main image field to limit the file name. For example, ...
0
votes
1answer
17 views

Display entity as options_select multi-select

Below is my code for the view. I have tried multiple = true, multiple_values=true, multiple = multiple. None have worked. ->setDisplayOptions('form', [ 'type' => 'options_select', '...
0
votes
1answer
30 views

Capturing cache metadata from file_create_url?

I'm writing a Drupal 8 controller which takes in a media entity, and returns a redirect response to the actual file URL. It works by finding the file associated with the media entity, and then does ...
-2
votes
0answers
11 views

make taxonomy hierarchy tree an image based navigation system

i would like to make a taxonomy tree accessible on the home page as a clickable images wall . Each click will redirect to the sublevel images wall ( child taxonomy list) or the final associated ...
0
votes
0answers
26 views

Upgrade modules

I am going from Drupal 7.6 to 8.6 using the migration UI (https://www.drupal.org/docs/8/upgrade/upgrade-using-drush). When I get to /upgrade/review it lists out the modules that need upgrading. The ...
0
votes
0answers
20 views

Implementing entity query to find/increment field values

Similar to this question but for Drupal 8, I have a custom node type with field_product_category and field_project_number. I want to increment project number based on a count of nodes with a specific ...
-3
votes
0answers
23 views

Drupal 8 Edit Content like Microsoft Power Point? [closed]

Is there any way we can put an option to have an editor like Microsoft power point where we can in real time add the text, video, and images, shapes to make it more creative editing where one image ...
0
votes
0answers
12 views

Log in error problem going to a /user/10 which is giving me problems

When I'm trying to log into my site, support.pegwriting, I'm redirected to http://support.pegwriting.com/user/10 and I get this error message: The website encountered an unexpected error. Please ...
1
vote
1answer
17 views

Parent module to link to sub modules - generated by sub-module [on hold]

I've got a parent module that shows a list of functionality available from its sub modules. I'd like the links shown related to sub-modules to be added by the sub-modules themselves rather than being ...
0
votes
0answers
11 views

Taxonomy menu views - multilingual - no results behavior

I am using "NO RESULTS BEHAVIOR" in Taxonomy menu views to show content in another language when default language content is missing (I have added a Global view area pointing to another view): it ...
0
votes
1answer
14 views

How do I remove product duplicates in a view?

In my view I have duplicate entities for my product list, this is different from Drupal 7 as you could use the distinct module. How can I remove the duplicates from my commerce product views in ...
0
votes
1answer
17 views

Disable translations update on module enable

I have large site with 15 languages, when working locally If I enable some module over UI (or reinstall it) auto update of translations kicks off and this last for some time. I really don't need that ...
1
vote
1answer
50 views

Can't connect to Redis

I'm trying to enable Redis on my Drupal site but when I check the status of the module I keep getting this warning message: No Redis client connected, this module is useless thereof. Ensure that ...
1
vote
3answers
116 views
+50

Add class to form-tag in in views exposed form via template_preprocess_views_exposed_form()

I wonder how I can add a class to the form tag (of the _search_content_ view's) exposed form using template_preprocess_views_exposed_form() (or even better ...
0
votes
1answer
11 views

Configure connection to mongodb for querying only

We have an external mongodb instance and we need to query data from it and bring it to Drupal 8 site. On shell this is how we connect (mongodb is running in a different container than drupal) mongo --...
2
votes
1answer
62 views

How to dynamically redirect user from /foo/X to /bar/X?

So far I did the following: I've installed Redirect and Token modules. I've applied the patch for Redirect module to support wildcards. I've applied the patch for Redirect module to implement ...
0
votes
1answer
61 views

Validation constraints on form fields ignored

Trying to figure out custom validation with constraints, but no luck yet. Right now, my form posts content and gives no errors when form is filled out incorrectly. (Please avoid suggesting ...
0
votes
0answers
22 views

Content will not publish when I hit sav [on hold]

I'm creating a blog for my work so someone else can add in blog posts. Comments are not being used. I make the content type specific for this blog. It was working a couple of days ago. Now when a post ...
0
votes
0answers
31 views

Remove string from [node:url] and node alias

Background We have enabled content translation where we detect based on the content language. This allows us to translate properly as needed, but it has a bad side effect. It will not only add ?...
0
votes
0answers
28 views

How do I render a node's link field in a page template?

I have a custom page template that's intended to display a couple of fields for a specific content type in an aside, along with the sidebar contents. My searching and reading seems to indicate that ...
1
vote
1answer
31 views

How to find where are defined tokens for Redirect?

After enabling Token and Redirect modules, I've found at /admin/help/token that I can use Redirect tokens. For example: However, I've got the problem finding the place where and how these tokens are ...
1
vote
2answers
27 views

How do I add an anchor attribute to a route?

I've created a route: regions.taxonomy_term.edit_form_header: path: '/taxonomy/term/{taxonomy_term}/edit' defaults: _entity_form: 'taxonomy_term.default' _title: 'Edit term' options: ...
1
vote
1answer
44 views

Handling access denied result

In Drupal 8, what is the correct way of returning access denied to a user (outside of access requirement on a controller)? I'd say it is to throw an AccessDeniedHttpException most of the time, but I ...
0
votes
0answers
12 views

Link with callback function

How can I build a link with callback function like this, but without necessity of href: $form['link']= [ '#type' => 'link', '#ajax' => [ 'callback' => 'myFunctionCallback', '...
0
votes
0answers
9 views

Update element form when modal closed

I have form with a link (it open modal): $form['link'] = [ '#type' => 'link', '#title' => t('Title'), '#url' => Url::fromRoute('example_module.event_form'), '#attributes' => [ ...
0
votes
0answers
28 views

Paragraph translation

I have a Drupal 8.6.3 site that is using translations. English and Arabic are the only two languages as of now. I'm having a problem with paragraphs not translating between the original, English ...
0
votes
0answers
15 views

Render a widget image programmatically?

I need to render this element (image-widget), in the image module I see that it has a template called image-widget.twig.html, but I do not know what information it needs to be able to render it. ...
-2
votes
1answer
22 views

Ensure specific JS files always load last? [on hold]

(I have looked at related answers, they provide no help because they make invalid assumptions.) I'm working on a job where the front-end is component-based. I have no control over this. Some of the ...
-2
votes
1answer
52 views

getting error when doing the composer install

Drupal version was 8.6.2 and moved to new server. When doing the core update , getting an error like below. Problem 1 - remove drupal/drupal No version set (parsed as 1.0.0)|remove drupal/core 8.6.3 ...
-2
votes
0answers
10 views

Site relative paths broken after migration

Relatively new to D8. Just moved a site from a staging environment to a local environment to map onto and work on a project. After moving the site, all the image paths are broken and some of the js ...
0
votes
1answer
23 views

Translation of label in yml configuration file

After having read https://www.drupal.org/docs/8/api/translation-api/overview and in particular Translation for shipped configuration and configuration schemas I tried to use this ability to have ...
2
votes
1answer
58 views

How to change the image size within a Drupal view

Does anybody know the best way to change the image size of a field within a view using Drupal 8?
1
vote
1answer
42 views

How to add pagination to programmatically rendered search result template

I am trying to implement the pagination in drupal 8 custom page. I have a custom array which I am rendering using theme, I need to add pagination for it. $internal_result = array_merge($...
-3
votes
0answers
18 views

I created a custom module to create forms, the forms created are not going to database [closed]

any help for "I created a custom module to create forms, the forms created are not going to database in drupal8". please.
-3
votes
0answers
38 views

How do I hide an AJAX form? [on hold]

I use AJAX for the login form, on Drupal 8. After the user is authorized, the message "Hello, username! To see the website as a registered user go to this link." is shown, but the form remains. How do ...
0
votes
0answers
25 views

How can I programmatically add a link that redirects users to a parent site?

I'm currently building a Drupal multi-site and I'm trying to figure out if there is a way to add a link programmatically that redirects to the Drupal parent site. Using {{ url('<front>') }} ...
2
votes
2answers
33 views

How do I display an error message on a basic page when the user does not have permissions to see the nested view inside the basic page?

I have a basic page, and inside of that basic page I have a view "newsletters". The view "newsletters" has permissions set on it based on role, so only admin and subscribers can see it. How can I ...
0
votes
0answers
13 views

Change media reference from private to public?

We have a site that has well over 500 files that were uploaded into the private file system. Management wants a change in functionality, however, that allows people to directly link to the media ...