Latest Drupal related questions

Score: 0
Better exposed filter for block view doesn't appear
pl flag

I created a new content type and a display page to show a listing of all my new content type pages. I'm trying to create a better exposed filter block on my page for the sidebar, but when I try to add the block view to my page, I don't see it listed.

I have another content type which uses exactly the same filters and I mirrored the same settings, but it still doesn't show up. I added this filter  ...

Score: 0
druplash avatar
Rewrite media field (PDF) in views
jp flag

In Drupal 9 i use a media field (field_pdf) in views to display PDFs. As formatter i use thumbnail. How can i rewrite this field to open that PDF in a new window on click? My different settings are do not work. The rendered url is not looking right. Thanks for any advice. enter image description here

Screenshots

Score: 1
Madan Kumawat avatar
How can I force user logout from a JavaScript library in a custom module?
in flag

I've written a custom module for Drupal 8 to monitor user device location frequently. If a user goes out of an allowed zone boundary, I need to force logging the user out of the website. I created following files in the module folder (gps_test):

  1. File gps_test.info.yml
  2. File gps.js: JavaScript program to monitor the user device's GPS location.
  3. File gps_test.libraries.yml: Contains the gps.js library ...
Score: 1
Jan Moris avatar
How do I share Google photos?
eg flag

I would like to have all shared albums of a certain google account automatically into a Drupal website. I was able to establish a connection with 'Google_photos_api' and show all shared albums on site with code below.

<?php
$GooglePhotosService = \Drupal::service('google_photos_api.client');
try {
  $optParams=array("pageSize" => 50);
  $SharedAlbumlijst = $GooglePhotosService->googleServi ...
Score: 0
Custom breadcrumb navigation, but url link shows page node
pl flag

I'm pretty new to Drupal and I'm creating a new content type. The site uses custom breadcrumbs built using BreadcrumbBuilderInterface for certain content types which was built before my time. I'm not very familiar, but it uses route_match. I added my content type to the list and my new pages appear in the breadcrumbs menu now, but I'm not sure why the page's url doesn't show the page title, but instead  ...

Score: 1
Drag and drop to sort taxonomy weight in a view
cn flag

I need to create a custom admin view to replace the default taxonomy term listing page for a given vocabulary. The reason is that we have added custom fields on the vocabulary and the admins need to see those fields on the term listing page. To be clear, I am not talking about the individual term page that shows the content attached to that term, but the actual admin listing page that displays all of th ...

Score: -1
mt.i.1 avatar
Set the quantity per product equal to value in input
us flag

I'm using the Commerce Ajax Add to Cart module to add a product to my cart using AJAX. I guess I'll have to do that by creating a patch.

It's working fine, but I'd like to change how a product is added to the cart. For example, users add 4 times the same product in the cart. I've already made some changes so the by default, the quantity in my item cart is four. For now, if users click on *Add to cart,  ...

Score: 0
Oscar Silva avatar
Under construction page when I enable https
in flag

I enabled https:// in a Drupal 7 site, but I get the Under construction page every time I try to access it. When I try to log in, I get a 404 error.

Can anybody tell me what I am missing?

I’ve used the default .htaccess and settings configuration.

Score: 1
Dadaisme avatar
How do I switch from a recommended release to a development snapshot?
in flag

Is there a non-Drush, Ludwig way to switch from the recommended release of a module to a development snapshot in Drupal 9, for example copying the development snapshot files and run update.php?

The Drush answer for Drupal 7 given in How can I update from the recommended release of a module to it development snapshot? suggests to do that.
In my case, I want to switch to the development snapshot of th ...

Score: 1
Sergey Kravchenko avatar
How to reload flagging form via ajax?
in flag

My task is to ajaxify complex flag form (with additional fields). I need this because the default ajax flag does not dupport fiedls. I need to have the flagging form for create flag and then update it when flagging has been created.

I want to place custom flagging ajaxified form in my template First I get form build:

$term = $variables['term'];
$flag = \Drupal::service('flag')->getFlagById('subscri ...
Score: 3
Frank avatar
Custom 404 handling for images
ly flag

I'm looking for a way to handle 404's on images in Drupal. I have created several subscribers, but none seem to get triggered. My first try was to create subscriber that extends RouteSubscriberBase. The alterRoutes method looked like:

protected function alterRoutes(RouteCollection $collection) {
    if ($route = $collection->get('system.404')) {
      $route->setDefault('_controller', '\Drupal\my_mo ...
Score: 1
Kartagis avatar
How to exclude taxes from total prices but still show the tax during checkout
lu flag

So I create a tax type Custom and set the rate 18%. The checkbox Display taxes of this type inclusive in product prices. comes in checked by default. If I leave it like that, cart shows product price as tax added and still displays tax line. If I uncheck it, cart shows product price as is but it hides the tax line. What I want is the combination of the two; I don't want to include the tax in the tota ...

Score: 1
sea26.2 avatar
How to control display of state_province field from the address module
om flag

Ok - the title is not terribly clear. I'm building a form that uses Advanced Address. That element comes from the Address module. I want to control the display, or perhaps a better way of saying it; I want to suppress the display of the State/Province input field unless one of three countries is selected.

I'm pretty sure there are multiple ways of going about it. I'm looking for the cleanest. May ...

Score: 1
Matoeil avatar
ConfigNameException: Missing namespace in Config object name xxx
za flag

Drupal\Core\Config\ConfigNameException: Missing namespace in Config object name media_entity_file_replace. in Drupal\Core\Config\ConfigBase::validateName() (line 97 of core/lib/Drupal/Core/Config/ConfigBase.php).

i don't quite get what i have done wrong in my config form

media_entity_file_replace/src/Form/MediaEntityFileReplaceSettingsForm.php

namespace Drupal\media_entity_file_replace\Form;

use Drupal\ ...

The Stunning Power of Questions

Much of an executive’s workday is spent asking others for information—requesting status updates from a team leader, for example, or questioning a counterpart in a tense negotiation. Yet unlike professionals such as litigators, journalists, and doctors, who are taught how to ask questions as an essential part of their training, few executives think of questioning as a skill that can be honed—or consider how their own answers to questions could make conversations more productive.

That’s a missed opportunity. Questioning is a uniquely powerful tool for unlocking value in organizations: It spurs learning and the exchange of ideas, it fuels innovation and performance improvement, it builds rapport and trust among team members. And it can mitigate business risk by uncovering unforeseen pitfalls and hazards.

For some people, questioning comes easily. Their natural inquisitiveness, emotional intelligence, and ability to read people put the ideal question on the tip of their tongue. But most of us don’t ask enough questions, nor do we pose our inquiries in an optimal way.

The good news is that by asking questions, we naturally improve our emotional intelligence, which in turn makes us better questioners—a virtuous cycle. In this article, we draw on insights from behavioral science research to explore how the way we frame questions and choose to answer our counterparts can influence the outcome of conversations. We offer guidance for choosing the best type, tone, sequence, and framing of questions and for deciding what and how much information to share to reap the most benefit from our interactions, not just for ourselves but for our organizations.