Questions tagged [8]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

How to display a result counter in the page menu link?

I have a navigation menu on my site, each menu link corresponds to a page of views. I want to display in front of each menu link, a badge with the number of results of the corresponding page views. ...
0
votes
0answers
10 views

How to load block content through ajax callback?

my_module.routing.yml my_module.content: path: '/my_module/path' defaults: _controller: '\Drupal\my_module\Controller\PageController::content' requirements: _permission: 'access content'...
0
votes
0answers
7 views

search api manipulates phrase

i have a site with search API and views. I configured and created my search. (The site is in hebrew), I noticed that when I search for a 4 letter word - lets say "ward"; I get results with the words :...
0
votes
0answers
23 views

How do I pass arguments from URL into panel page block?

I have created a view with a contextual filter set to a taxonomy term. I am attempting to use the view block in a panels (page manager) page and pass the taxonomy term from the URL into the block. I ...
0
votes
0answers
14 views

How do I migrate the content of a book?

I have a Drupal 7 site I want to upgrade to Drupal 8. I take this occasion to rethink the structure and theming, but I would like to extract/copy/move/import the book content from the original site ...
-2
votes
0answers
16 views

How to customize node view [closed]

I have this node view for my custom node. What I wanted to do is edit the files into button and the pictures into carousel. How can I manage that? Thank you
0
votes
1answer
18 views

RESTful Web Services : How to simply post a paragraph entity

I have simply activated the default paragraph ressource with core (8.8.3) module : I would like to post a paragraph but even just with the "type" field, I got 403 error in response ! I have nearly ...
0
votes
0answers
21 views

Is there a way to use the core Media module with an existing image field?

I have a site with a lot of nodes already using an image type field where I'd like to switch to using a Media browser (for consistency with other areas of the site). It seems a media browser can only ...
-1
votes
2answers
35 views

Checking for the content type in html.html.twig

In the html.html.twig template, the task is to output different classes for the <body> tag, depending on the type of content. I know how to do this in the node template, but it doesn't work in ...
0
votes
0answers
30 views

How to refer to an entity with a start and end date?

my question is complicated :-( My site is a marketplace, that is to say that it brings together several stores belonging to several owners. I want to set up pop-up stores. These are temporary ...
0
votes
0answers
18 views

Admin toolbar CSS broken by theme

I'm facing issue with Admin toolbar. Every time I create theme and define default style guide for typography eg.: ... h2 { font-size: 3rem; } p { font-size: 1.2rem; } ... Admin toolbar's CSS is ...
0
votes
0answers
26 views

Decoupled back-end and front-end

I'm looking for the best way to use Drupal as a front-end for a decoupled Drupal back-end. The set-up I'm looking to accomplish is: a Drupal 8/9 back-end as a central content repository 3 Drupal 8/9 ...
0
votes
1answer
12 views

Get Webform Category Name in Preprocess

I am trying to get the Category name (from the General form settings) for webforms in a preprocess function, ultimately to add as a class to the webform wrapper. MYMODULE.module: function ...
0
votes
0answers
11 views

Security review: Some files and directories in your install are writable by the server

I am running Drupal 8 on a vps running latest ispconfig/apache fastCGI. Security review module reports: "Some files and directories in your install are writable by the server." and basically lists ...
0
votes
0answers
17 views

Hide view's elements onfirst load, show them on filter click and reset it again by general data filter

Edit As my first question I made some mistakes, so I'm trying to keep it more clear and useful for other people. The scenario: I built a View showing nodes and contextual filters to have taxonomy ...
0
votes
0answers
19 views

Twig alter replacement patterns / rewrite results views field

I have some text I'd like to alter in the custom output of a views field. For example, if the output contains the word "pancakes" I'd like to replace it with "waffles". {{ field_recipe_prep__value ...
-2
votes
0answers
11 views

Using if else statement in Views “FILTER CRITERIA”

I added a field "isFirst" type Boolean to content type "Publication". I create a block that display just the latest one publication that its field (isFirst == true). I want that the block display the ...
0
votes
0answers
17 views

How to get block relationships in a Views content type? (3 references in a Views)

As part of a migration from drupal 7 to drupal 8, I currently have a rather original node display method that I'm trying to reproduce to Drupal 8, but without success. Currently on Drupal 7, this ...
0
votes
0answers
16 views

How can I compile Bootstrap file locally?

I just installed Bootstrap 3 theme on a fresh Drupal 8.8.4 installation. For the moment the theme is using a CDN. But I want to use bootstrap core locally. So did this : I downloaded a bootstrap 4....
0
votes
1answer
54 views

Add Vue.js to theme best practices

I want to enhance some parts of the frontend UX of my Drupal theme with Vue JS. I made a Webpack setup to compile and build my SCSS and Javascript. What is the best way to add the Vue JS library to ...
0
votes
0answers
20 views

How I fetch the markup from a component to use in a controller response?

I'm using Components in our theme which is working well, but I'm having trouble finding documentation on how to retrieve and render a particular component as a controller response. I want to return ...
1
vote
1answer
25 views

Possible to use EntityStorageBase::loadByProperties() to specify that field is or is not empty?

Is there a way to use EntityStorageBase::loadByProperties() to specify that a field is either empty or not empty? I just want to check whether or not a field_date_completedhas a value set one it. ...
0
votes
1answer
36 views

Language code and country code on the URL

I've been trying to achieve this: I have a multilingual site with 8 languages (en, fr, es, de, etc) and I want to make all those language available for all countries. I want Drupal to understand ...
0
votes
0answers
15 views

When the view has no result with the paragraphs, there is an error

I created a view to display a block on my store page. But my page displays an error when the view has no result. If the view has a result, it works. What's the problem ? When I go to my store page, I ...
0
votes
1answer
74 views

How to redirect after node insert (not form redirect)?

I am trying to find out how to redirect after I insert a new node. All the answers I have been able to find discuss $form_state->setRedirectUrl(); but this is a form redirect; not a proper redirect ...
0
votes
0answers
34 views

What existing Drupal 8 module installs software required for running tests (PHPUnit, etc.)?

Running tests in Drupal 8 requires certain software to run, of course. However, I was surprised to not find a module, up-to-date set of instructions, or other turnkey method of identifying and ...
2
votes
2answers
33 views

Which event should we subscribe to if we want code to be triggered when a new user registers?

I noticed that the following event is defined for when a user account is 'set const SET_USER = 'account.set'; I want to execute code by creating an event subscriber when a new user registers on the ...
0
votes
1answer
23 views

is it possible to populate subclass of FieldItemList from code?

The context first: I'm migrating a website from D7 to D8 and one of the modules has no update on D8. I found an alternate module with the same functionality. For the FieldType of the alternate ...
0
votes
1answer
28 views

Unable to retrieve checkbox values from a template file

I have created a checkbox option for a field. Category One Two Three Four This is the code I am using. {% for key, item in content.field_room_category if key|first != '#' %} <li>...
0
votes
0answers
12 views

Unsetting formatter's third party settings

We have this hook hook_field_formatter_third_party_settings_form that allows us to set third party settings in formatter settings form. But what would be the best way of unsetting them if we are ...
1
vote
1answer
37 views
+50

Custom node access control not working with access filter?

In some of mine content types I have checkbox field "Content protect". If checked that node should be visible only to registered user. If not checked - visible to everyone: function hook_node_access($...
0
votes
0answers
30 views

Upgrade 8.4.8 to 8.5.11 error Inspector not found

I'm trying to upgrade from Drupal 8.4.8 to Drupal 8.5.11 but I'm stuck on the following error Drush command terminated abnormally due to an unrecoverable error. ...
-1
votes
0answers
21 views

How do I add translations to a site?

My site supports 10 languages and English. I am trying to translate the names of the USA states and the Canada provinces. On https://localize.drupal.org/, I can only find the translations for the ...
0
votes
1answer
68 views

Create cookie after download file

I want to create a cookie after a file download. This is an extension on the existing module: https://www.drupal.org/project/file_utility Each time you click on a download, a popup opens. For me it ...
0
votes
0answers
24 views

How to override images in node's content? [closed]

Our site is having issues because of the high resolution images inside our articles. We already have thousands of articles so editing each of it is not optimal. I'm kinda new in drupal and I just need ...
0
votes
1answer
37 views

Get domain from a URL field

I have a link field in a content type, field_source. I created a computed field (field_source_domain) in the same content type, which should contain the domain for the link in field_source. I tried ...
1
vote
1answer
31 views

How do I execute code when a module is installed or uninstalled?

Currently, I manually have to add terms one by one every time a module gets installed, and that's not efficient. I'm writing a simple module that needs to automatically install 2 terms every time the ...
0
votes
1answer
14 views

How to map Address field module sub fields (City, State, etc.) to specific (individual) fields in Salesforce?

Address module: https://www.drupal.org/project/address Usually Salesforce mapping doesn't allow to add Address module subfields in the mapping.
1
vote
0answers
31 views

When I clear cache, my menu ordering seems to go out of order

When I clear cache, especially on high traffic times, my menu seems to go out of ordering. Usually I don't see any log messages except for one time: Message Drupal\Core\Database\...
0
votes
0answers
20 views

How to optimize the Glyphicons font with font-display: swap? [closed]

I want to optimize the loading of the Glyphicons font for the Google PageSpeed Insights tool. I need to apply the CSS code below : font-display: swap Here is the location of my font : https://...
0
votes
1answer
30 views

Control Visibility of Paragraph Without Fields

I'm preprocessing a paragraph to add a custom form but I'm having trouble with the visibility. I don't need any fields on this paragraph. If I just add the form to the paragraph the whole paragraph ...
2
votes
1answer
59 views

Drupal in sub directory, still not clear

My drupal project is in directory /var/www/MY_ORGANIZATION/MY_PROJECT/current, and apache2 is configured to point the web subdirectory of the above location. When I access the site, it is of course ...
0
votes
0answers
32 views

Can I set form field disabled in Controller?

I can make form field disabled with hook_form_alter. But can I somehow set form field disabled in Controller? namespace Drupal\mymodule\Controller; use Drupal\Core\Controller\...
1
vote
2answers
58 views

How to change Taxonomy admin page title?

I simply need to change the title on the (Drupal 8.8.4) administrative page which lists the existing vocabularies. As far as I know/read, the routing.yml should be modified, shouldn't it? (Is only ...
0
votes
0answers
16 views

How can I populate and entity reference field/videos that have been previously migrated to the media library?

Upgrading from D7 to D8, we previously migrated D7 youtube and vimeo videos to the Drupal 8.8 core media library. We now are attempting to migrate the Video nodes and their media library video fields ...
1
vote
1answer
21 views

Views alter changes next row instead of current one

I have a view that is showing event content types. Users can apply for these events. I am using a hook to alter the 'view applicants' so I can show how many applications already excist. The ...
0
votes
0answers
25 views

High_contrast error after 8.4.4

After the 8.8.4 update I am getting the following error when I try to clear caches: Circular reference detected for service "theme_handler", path: "twig -> twig.loader.filesystem -> theme_handler ->...
0
votes
0answers
9 views

Views Data Export - Exporting a Referenced Media Item's URL

I need to create an Export to CSV from a series of pieces of content. Each piece of content uses a media field that I am trying to reference. The rest of the fields export fine, but I am unable to ...
0
votes
1answer
26 views

Filter nodes by today's date

Following what described in Views filter criteria date field is greater than current date, I have used operator >= today with some success. I would like to create "future" nodes and they should be ...
-3
votes
0answers
23 views

Entity type does not exist [closed]

I am not able to solve this error and have been trying for days now. Please help? Drupal\Component\Plugin\Exception\PluginNotFoundException: The "brick" entity type does not exist. in Drupal\Core\...

1
2 3 4 5
285