Latest Drupal related questions

Score: 0
julianx2rl avatar
How can I use the time.html.twig template for the node "created" field?
cn flag

When a view shows a date from a newly created field, it uses the time.html.twig template. When it shows the node created field, it just prints a string surrounded by <span> tags.

I'm guessing I just have to somehow specify that the created field must be rendered using the time.html.twig template, but I don't know how to achieve this.

How can I set a view to render the created field using the t ...

Score: 0
Blocks activated on Article content type
us flag

My website has heading blocks that appear for certain pages and (as expected) I have to specify that each heading block should only appear for /node/xxxx.

I have an Events content type, which are all articles. I would like to have a specific header block show up only for Events, if possible. I will have many, many events and would like to automate that process (if possible.)

I have not yet found a m ...

Score: 0
Calling setExposedInput() from a Drush command doesn't have any effect
ve flag

We have a custom Drush command implemented using the following code.

class JobApplicationExportCommands extends DrushCommands {

  /**
   * Exports Dorea Job Applications since the last run to csv
   *
   * @command dummy:job-application-export
   * @aliases duje
   */
  public function drush_dummy_export() {
    $applicationWebformIds = Drupal::entityQuery('webform')
      ->condition('category', ...
Score: 0
Tom C avatar
How to address the field value in a node from a webform
ru flag

I'm using Drupal 8 together with the Webform module.
Is there a way to transfer the value of a field in a specific content type to a webform?

This is the situation:
There's a content type called 'Vacature' where you create the specific content (vacancies). When adding a new vacancy I provide a field called 'vacaturecode' and a dropdown where you select the application webform that will be used to app ...

Score: 1
scaffolding avatar
Accessing node value in paragraph twig template
es flag

I'm writing a twig template for a paragraph. I'd like to access a text field value from the page/node where this type of paragraph will be added.

Specifically, I'd like to access the value of a text field titled 'field_runner_id'. I access this value in my page/node twig template like this:

content.field_runner_id|field_value

I've tried a handful of techniques (listed below) to access that field value wi ...

Score: 0
How can I print recipient mail address in webform email handler body with twig?
us flag

In the webform e-mail handler configuration I can see that webform twig variable is available. I looked to the context with xDebug and it looks like I should be able to print e-mail address of the recipient with in the mail body. But it doesn't work, the body is empty. Do you know why and how can I fix this?

{{ webform.handlers.e_mail.settings.to_mail }}

Edit: I also tried to use token like this: ...

Score: 0
hukka avatar
Enabling MFA on some routes when using simpleSAMLphp Authentication?
ng flag

We're having a Drupal 8/9 setup acting as an SP with simpleSAMLphp Authentication module, against Shibboleth IdP. Now there's a need for including an app on certain pages, and the users using that app need to be multi-factor authenticated. By default, only single factor authentication is on. The IdP is not in our control but it supports MFA by passing AuthnContextClassRef with correct value in the au ...

Score: 0
Pieter L avatar
Use first 3 digits of views contextual filter as filter criteria
nr flag

I have a view that fetches a Belgian postal code, which always has 4 digits, from the URL and uses it as contextual filter to only show nodes for that postal code. This works fine.

I would like to also show sub-localities in this view. Given a postal code equal to 9990, the view should show the node for 9990 but also the nodes for 9991 and 9992, and other nodes whose postal code's first three dig ...

Score: 1
shelane avatar
Is there a way to disable the option for menu links?
cn flag

For our unified Drupal platform, we require all of our sites main menu items to be a page and any sub-pages to show a path following the parent menu item. So if "About Us" (with a path of /about-us) is a top level menu item, it must be a page. And the page "History" under that will have a path of /about-us/history. "About Us" cannot be a <nolink> with History as a child. How can I prevent users ...

Score: -1
BlondeSwan avatar
What is Pages (from D7 and D8) replaced with in D9?
br flag

I'm working on a D9 project that we just migrated from D7, but there doesn't exist a admin > structure > pages link. What was this replaced with? Same with Panels, I still see Panels as a Content Type, but what about a structure?

All I could find online was "How to create a Basic Page". I want more than a basic page, I want to structure pages together.

Score: 2
Bisonbleu avatar
How can I capture a field’s configs and storage so I can delete it and then re-create it?
pl flag

I’m trying to implement this in a hook_update_N() but I’m not sure it’s proper (see excerpt below). Note I’m changing max_length in the process.

What I'm trying to do: update my_custom_entity.field_my_custom_field which has saved data into it. So I need to:

  1. Store that data
  2. Store the field configs - if that’s possible?
  3. Store the field storage - if that’s possible?
  4. Delete the field
  5. Create the f ...
Score: 0
blur avatar
Can I display how many questions left in a form from the Webform module?
bn flag

Is there a non-code way to show how many questions are left in a multipage webform module? For 508 reasons we (at work) use multiple pages for forms. Some pages have 2 questions while other have have a bunch. Is there any way to let the user know how many questions are left?

I guess the count would be nice on a per-field basis, but that might be a lot to accomplish. Even a count of what's left af ...

Score: 1
Is getting 5 "runs" per page normal?
ng flag

I have installed tideways in my Drupal VM and the XHProf module in Drupal. When I load a single page of my website (the homepage), I am getting 5 "runs" per page. Is that normal? The first run seems to have a much higher load than the following 5.

Score: 0
J.g avatar
Getting the version history of a node
us flag
J.g

Is there a way to get the versions history of a node using REST or JSON API? I would like to be able to view all version IDs of a node in JSON format.

Score: 0
abe-cedarian avatar
Within a node template how can I tell what regions are in use/ occupied?
kr flag

I am trying to create a preprocess function in my .theme file in order to make a variable available to node templates.

I want the variable to contain just the names of all regions that are currently in use (i.e. rendering content).

The idea being, if I have a region called left_hand_nav which is rendered on some (not all) pages, and I have a node called generic_page, from my generic_page node templa ...

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.