Latest Drupal related questions

Score: 0
Yurii Kovalchuk avatar
Redirects from https to http
cn flag

I want all of my url to end with slash. But I'm facing a trouble where i have a redirect cycle.

For example: https://mysite.com/blog -> http://mysite.com/blog/ -> https://mysite.com/blog/

So there is an unnecessary redirect from https protocol to http. At first i thought that it was gatsby-plugin-force-traling-slashes, website is built with Drupal9 + Gatsby. I removed this plugin, but redirects kept ...

Score: 0
Volkmar avatar
CSS & JS from programmatically rendered node
us flag

I have a problem and I can't solve it myself at the moment: In a view, I output some fields of a content type (through id in the context filter) via "REST export". With this view, I would now also like to output css, js and the content of the of the rendered content in a field. For this I built a serializer plugin, where I render the respective content beforehand:

$nid = 36;
$entity_type = 'node'; ...
Score: 1
Matt avatar
Add tab for custom entity type on content page
cn flag

I made a custom entity type and I'd like it added to the tabs on the content page seen below.

enter image description here

My custom_entity.links.menu.yml Looks like this

entity.custom_entity.collection:
  title: 'Custom Entities'
  route_name: 'entity.custom_entity.collection'
  description: 'List Custom Entities'
  parent: system.admin_content
entity.custom_entity.add_form:
  title: 'Add Custom Entity'
  route_name: 'entity.c ...
Score: -2
Bavramor avatar
PDF template page numbers
sg flag

I am currently trying to insert page numbers to generated PDFs. I tried the following solution with CSS counters, in the entity-pring.css file.

.page {
  padding: 20px;
}

.page img {
  max-width: 100%;
  height: auto;
}

.page td img {
  max-width: none;
}

@page {
  margin: 50px 25px 100px 25px;
}

#footer {
  position: fixed;
  bottom: -60px;
  left: 0px;
  right: 0px;
  background-color: #ffffff; ...
Score: -1
sairiq avatar
Show title of a referenced node
ph flag

I have a node type of "Countries" and node type of "Continent". On the "Continent" node type, I created a referenced field of countries (field_countries). On my Countries search views page, this view displays the list of countries and the link to their respective page. Is it possible to show the Continent (field_title) where the country (field_country) is referenced in?

For example:

United Kingdom
https ...
Score: -1
erik avatar
How to make a check that my entity title field is written to needed database table and that no other field is written there?
my flag

I have an entity called Entity Product. And this entity has a form, if you change the Title field in this form, Drupal will automatically save the new value of this field in the appropriate table in the database, but in addition, I also save the change of the Title field in the form to another database table product_product by creating a _custom_product_save_title function. It is necessary. And this fun ...

Score: -2
Display forums & books in admin theme?
in flag

is it possible to display some forums & books in administration pages?

i have some documentation regarding the content creation that should be kept private. also a 'behind the curtain' forum would be a great feature for me.

i want my to keep my front theme lightweight.

Score: -3
Shyam3089 avatar
Create a pdf from a custom module using entity print module
us flag

I have created a custom module and it has a path /{nodeid}/{userid}. I'm using Entity Print module to create pdf. I'm trying to render the pdf using a link (/print/pdf/node/{nodeid}/{userid}) as mentioned in the documentation. But this simple loads a page not a pdf.

Drupal version is 9.

module routing yml:

  certificate.content:
      path: '/{nodeid}/{userid}'
      defaults:
          _controller ...
Score: 0
bem22 avatar
How do I pass a variable to a template file?
in flag

I have a template that defines a module that builds a paragraph.

This paragraph uses a field reference to link another type of content.

In my main paragraph I call this reference content with

{{ content.field_hero_slider_item_reference }} to display it.

This works, but I would like to be able to pass variables to it so that I can style the individual elements inside the reference with attributes from a ...

Score: 4
Rubix05 avatar
Is it possible to have a nested SELECT in a WHERE clause using dynamic queries?
cn flag

I need to execute this SQL query using dynamic queries.

WHERE (node_field_data.status = 1) 
AND (node__field_document_places.entity_id IN (SELECT entity_id FROM node__field_document_places where field_document_places_target_id = 51673)) 

This is the code I am using.

$connection = Database::getConnection();
$query = $connection->select('node_field_data', 'node_field_data');

$query->condition('n ...
Score: 0
loker avatar
How can I update the node date for all nodes
cn flag

I have imported a number of nodes to a fresh installed Drupal 9. Later, the original content creation date (from the previous website) became important.

I have the information according to the new node ids. I don't know where to update?

I have tried to update the created and changed columns in node_field_data table, but in the content list I still see the import date... Where should i look? (of cour ...

Score: 0
octogone.dev avatar
How do I import/add terms to content without removing the existing ones?
bf flag

currently when importing term with feeds all the existing term of of a content are removed and then the terms are imported.

Is there a way to add terms during an import and keep the existing ones?

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.