Latest Drupal related questions

Score: 0
Using Views to list nodes that have the same field value as current node
se flag

I have a content type with has one particular field (among many other fields).

I need to create a block that will list all other items of that content type with the same field.

Doing this for related taxonomy terms is easy: Contextual Filer --> Taxonomy term ID --> Taxonomy term ID from URL --> Limit terms by vocabulary --> Vocabulary

But I can't get to the contextual filter work for say fi ...

Score: 0
Preprocessing view if grouping is enabled
sa flag

Views has base template views-view-unformatted.html.tpl with contents:

{% if title %}
  <h3>{{ title }}</h3>
{% endif %}
{% for row in rows %}
  {%
    set row_classes = [
      default_row_class ? 'views-row',
    ]
  %}
  <div{{ row.attributes.addClass(row_classes) }}>
    {{- row.content -}}
  </div>
{% endfor %}

Where variable {{ title }} - mean The title of this grou ...

Score: -2
user3463733 avatar
How can I install centreon/centreon?
fr flag

My website is built with Drupal 8.3.2. I want to update to to Drupal 8.9.x, but I don't want to move to Drupal 9.x. I ran the following command.

composer update drupal/core-recommended:8.9 --with-dependencies

I am getting these errors. The site uses PHP 7.3.33.

Could not load package centreon/centreon in http://repo.packagist.org: [UnexpectedValueException] Could not parse version constraint optimize ...

Score: 0
liquidcms avatar
$node->save() fails when run in post_update
us flag

I have a simple hook_post_update function which fails with the following error:

[notice] Update started: ssc_custom_post_update_9001

[error] LogicException: Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call. Use renderPlain()/renderRoot() or #lazy_builder/#pre_render instead. in Drupal\Core\Render\Renderer->doRender() (line 244 of E:\www\myssc\html\ ...

Score: -1
Should installing local Drush and Drupal via Composer on my personal computer be any different than on hosting platform?
vn flag

Should installing local Drush and corresponding Drupal via Composer on a personal computer with Ubuntu-Apache-MySQL-PHP be any different than on a shared hosting platform?

Should I just do the following in both environments?

cd web_application_root
composer create-project drupal/recommended-project my_site_name_dir
# PHP MYADMIN GUI
# GUI install
composer require drupal/metatag
Score: 1
Drupal 8/9 Layout Builder and default custom block
fr flag

We have a number of custom blocks that we've created, and use Layout Builder so that our authors can just drag and drop as needed. We have one Hero block in particular that we would like to see on every page (customized per page), and would love to automatically insert one on node creation for ease of authoring. You can almost do this via default layouts for the content type, but the default block acts  ...

Score: 0
erwan1974 avatar
How to create a new submission from a previous submission?
cn flag

Currently, when I submit a new form, there is no problem (WebFormSubmission::create() and save()). When I reload this Webform submission and modify some fields of form and record it, there is no problem (WebformSubmission::load() and save()).

But I not able to create a new Webform submission from this previous Webform submission. Aim is to have 2 independant submissions.

I tried to create() and save ...

Score: 1
MenuLink vs MenuLinkContent - what's the point?
in flag

I'm struggling to figure out relationship between MenuLink and MenuLinkContent.

I'm creating new menu item like:

$menuItem = MenuLinkContent::create($params);

I can also query those elements like:

$menuItems = \Drupal::entityTypeManager()->getStorage('menu_link_content')->loadByProperties(['link.uri' => "internal:$path"]);

And that works well. Now if I need one of those object I want to get it ...

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.