Latest Drupal related questions

Score: 1
Henk schipper avatar
Custom admin theme showing links in backend from frontend
us flag

So im new to drupal and i'm learning on how to use custom theme's by reading theming drupal. There is a topic about sub theming and I thought it was interesting to make a sub theme from the default admin theme seven. So I just follow the steps adding all the regions also.

So my frontend is having this as content (default stuff); frontend content

But the problem is, it is also showing it in the backend;

backend content

While i didnt ch ...

Score: 0
Sanjin Rosic avatar
Multiple image sets shown in a view using Colorbox
nz flag

I need to have multiple image sets in a content type. I need to output them in a view that would show first image in the set (and cycle through the rest in that set) in Colorbox.

I tried to set up a paragraph instance that has an image field and a caption (text) field. It works great for the content editor because it looks like a set. They can keep adding images to one paragraph instance and can click  ...

Score: 0
Rubix05 avatar
Sharing Heavy Operations between multiple Page Elements
cn flag

I have a page with two separate page elements. One is a table-select form that shows an extensive list of content data. The other page element is a block that shows a summary of that same content.

Both elements really use the exact same data, the summary block just needs to compile the table data into an overview. Reusing the data is vital because the database queries are rather expensive.

Is there  ...

Score: -2
Adding select list to tableselect output
pt flag

I'm trying to add a select-list to some table output but the markup is rendering as text.

$header = [
  'col1' => t('COL1'),
  'col2' => t('COL2'),
];
$rows = [
  1 => [
    'col1'  =>  'row-1-cell-1',
    'col2'  =>  'row-1-cell-2',
  ],
  ['col1' => 'test'],
  ['col2' => 'test'],
  ['col1' => 'test'],
  2 => [
    'col1'  =>  'row-2-cell-1',
    'col2'  =>  $form[ ...
Score: -2
Dario Vranjković avatar
MInified CSS file isn't loaded on a page where I have a webform with the "file upload" component
cn flag

I added a webform with the Upload file component on a page.
When I visit that page without minifying CSS files, everything works fine; when CSS files are minified, this page doesn't load them, the page seems a WSOD. The other pages work fine.

When I remove the Upload file component, everything works fine.

Score: 0
user3560198 avatar
How to check if a path is for a view?
in flag

I have a list of paths and I would like to identify which ones are associated to view routes.

Is there any Drupal 8 method I can use? Do I need to get all the view routes and then check which ones are associated to the paths I have?

Score: 0
Using template variations from the modules folder
lc flag

I have the usual theming solution for a custom entity:

function module_theme($existing, $type, $theme, $path) {
  return [
    'customentity' => [
      'render element' => 'elements',
      'template' => 'customentity',
    ],
  ];
}

function template_preprocess_customentity(array &$variables) {
  $variables['content'] = [];
  ...
}

function module_theme_suggestions_customentity_alt ...
Score: -2
Đức Lê avatar
Access denied at all pages
us flag

Suddenly, I can not access any of my pages, any page I try to visit tells me "Access Denied" and only show me site's logo, at all admin's pages and front pages. Everything happens when I install the "menu per role" module and turn it on.

Any idea what could cause this behavior?

Score: 1
Ex0r avatar
Making custom template & variables in module
cn flag

I am working with D8, and don't usually do themeing, so I am stuck on a problem.

I have a custom route in a custom module that calls a method checkinConfirmation() on a controller.

Inside that controller, I have this:

public function checkinConfirmation() {
  $output['items'] = [
    '#type' => 'fieldset',
    '#title' => t('Checked in items'),
  ];
  $output['items']['name'] = [
    '#prefix' =&gt ...
Score: 1
Liam Morland avatar
Why do drupal-media elements not get rendered in Layout Builder CKEditor?
cn flag
  1. In Layout Builder, add a custom block.
  2. When editing the block in CKEditor, add an image using "Insert from Media Library" button.
  3. Exit CKEditor.
  4. Re-edit the block in CKEditor.

Result: I do not see the image (rendered drupal-media element). If I reload the page and edit, I see the rendered image. The image appears the first time I edit in CKEditor but not on subsequent times during the same page load.

Score: 0
MrSnrub avatar
Is there a way to add a variable to the variable table through the Admin menu
in flag

Can I set a new key/value pair for the variable table from the Administrator admin/config menu in a Drupal 7 site? I don't want to have to create a one-time custom module that only contains a variable_set() function.

Score: 1
J.g avatar
?_format=json does not produce JSON for files, REST
us flag
J.g

I am using Drupal 9.3 with REST UI, RESTful Web Services, and Serialization enabled. For the REST UI, I have the following configuration for files:

Methods: GET, POST, DELETE, PATCH

Accepted request formats: json, xml

Authentication providers: cookie,

but when I try to get a json for a file (by appending ?_format=json to the url), I just get the file itself back (in other words the page is the same as  ...

Score: 0
BassPlaya avatar
How to export 1 or several specific rules?
ma flag

I want to export one or more specific rules or components using Drush.
I do have a script to export all the rules and components.

drush --pipe rules-list | xargs -I{}  sh -c "drush rules-export '{}' > '20210623-new-Rules-export-offline/{}.txt'"

20210623-new-Rules-export-offline is the directory where the exported rules are saved.

Is there something I need to change to this code in order to export th ...

Score: 0
Harshit Thakore avatar
View Bulk Operation with custom action
cn flag

I have a custom action to update some table values base on node content selection. My custom actions are listed correctly on bulk update select box. But I can perform operation some random node content only. Any thoughts!! why It's allow actions to perform on some contents only.

View Bulk Operation: https://www.drupal.org/project/views_bulk_operations

Tried Version: 8.x-3.13 , 4.0.0-rc1

<?php

namespac ...

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.