Latest Drupal related questions

Score: 0
Davoti Molla avatar
How to change the position of status message for an embedded node?
cn flag

I have an embedded node that uses JavaScript.

I have added a message.

const messages = new Drupal.Message();
messages.add(
  Drupal.t('Please select option'),
  { type: 'error' }
);

The message is shown at the top of the page. How can i move the message to the top of the embedded node instead?

(embedded node is at the bottom of the original node)

Score: 0
0711master avatar
Counting node type in View throws SQL error
cn flag

I have field Content:Type that I aggregate with COUNT to show the number of nodes of that specific content type. But I get this SQL error:

SQLSTATE[42000]: Syntax error or access violation: 1140 In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'db.node_field_data.nid'; this is incompatible with sql_mode=only_full_group_by: SELECT "node_field_data"."nid" AS ...

Score: 2
Set Body Class if Facet is active
in flag

I need to set a body class if a facet filter is active.

It should be done in yourtheme_preprocess_html

if Facet is active
then
$variables['attributes']['class'][] = 'facet-active';

for fulltext search terms it works like that

  $variables['attributes']['class'][] = 'search-' . \Drupal::request()->query->get('search_api_fulltext');

Anyone know how to dig out the information if a facet is active or ...

Score: 0
Tobias Jeschke avatar
Webform rendered entity display
cn flag

can someone give me a hint how to influence the "default" display behaviour of a webform submission rendered entity within a view ? i have a webform using multistep pages and details-elements, both appear as detail elements within the rendered entity, which is fine. but they are expanded, and i want to display them collapsed by default. Any idea how to alter the gereneric display behaviour ?

Score: 0
How do I dynamically (AJAX) show radios in form API?
au flag

A form like the following is expected to show additional fields when user selected "Yes" in the "Show more" radio button. When shown, the more section has a "Name" text field, and a "Gender" radios set.

But it never works as expected. The "Gender" label will be there, but the radio buttons are never rendered. I know changing "Gender" into radios would work, but for some reason, I need to use mult ...

Score: 0
Select by drag and drop
iq flag

I need to build a form for an event registration where people can select the workshops in order of their preference. In Drupal 7 I used to have a grid with radio buttons, but that does not seem feasible in Drupal 9. So I thought about making the list of workshops draggable and send the final order as part of the registration in the email.

Because the workshops differ every year, it must be relati ...

Score: 0
pglatz avatar
Where do source trees for different versions of contrib modules reside?
in flag

I made a contrib module that has a 7.x version. I just created an 8.x version. Do I create a branch within the existing 7.x version for the new code, or create a separate version for the 8.x? If they share the same module, do I switch to the 8.x branch, then delete the 7.x code and add the 8.x code?

Score: -1
Base field defined as entity reference with cardinality unlimited, only allowing one entry
fi flag

I have defined a custom entity type "Event" and I want a field on it called "Attendees" which should allow the user to enter multiple attendees.

I have defined the field thus:

   $fields['attendees'] = BaseFieldDefinition::create('entity_reference')
  ->setLabel(t('Attendees'))
  ->setDescription(t('People attending this event.'))
  ->setSetting('target_type', 'oc_actor')
  ->setSetting('h ...
Score: -1
Cannot make page--node--nid to work
se flag

For a node whose content type is Page and whose ID is 112, I created the page--node-112.html.twig template file, but Drupal is still using the page--page.html.twig template file.

How can I make Drupal use the page--node-112.html.twig template file?

Score: 0
Divya K avatar
Contextual Quick Edit icon is missing for some of the blocks in Drupal site
cn flag

Am using Layout builder for the website. On some of the pages am not able to see the Contextual Quick Edit icon. This will not allow us to do any configuration for the particular block/Page. Please help me to solve this problem.enter image description here

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.