Latest Drupal related questions

Score: 0
thiokol avatar
Related content by taxonomy term but using a relationship between terms
cn flag

There are many posts and tutorials for creating views with contextual filters to display content that shares the same taxonomy term, but my requirement is slightly different.

I want to create a view that displays content that is related to the content being viewed via taxonomy terms BUT I do not want the related content to be based on the SAME taxonomy term, but instead a related taxonomy term.

I th ...

Score: 0
user42221 avatar
How to list Links/Attachments in sidebar second
cl flag

When managing fields for a given content type in Drupal 9, I would like to be given the option to list all items of a given field (e.g. Links, Attachments, ... ) in a specific region (say, sidebar second), rather than at the bottom of the page (as is default).

Can this be accomplished by CSS?

Can this maybe be accomplished with the Display Suite module?

Score: 0
How to display a content-management-system-agnostic contact form I have developed, just without iframe?
sg flag

I have developed a simple, content-management-system-agnostic[1] PHP-HTML-JavaScript-CSS contact form which I normally embed by iframe but I no longer want to use iframe due to the form appearing partially in mobile display with scrolling needed to view all of it.

I can use this CSS as a partial solution:

@media screen and (max-width:733px) {
    #prcf_iframe {
        height:547px;
    }
}

This  ...

Score: 0
miststudent2011 avatar
How to Update Multi Value Entity Reference Field Programatically
fr flag

I have two Node Content Types type_a and type_b I have a field called as field_author_profile in type_a which is entity reference field to type_b with cardinality unlimited.

How do I update field_author_profile programatically.

I also need to Check if value already exists in the field , if exists then append the new value while updating the field value or else just assign the value.

I tried the below var ...

Score: 0
How to put a phone number in one place and call it from various other places?
sg flag

Let's say I want to store my phone number in some "Drupal variable" and then call it anytime I need it, in, say, a node or a block.

The purpose is not the repeat the phone number and change it from one place in case I replace my number to a new number.

How to do that?

I would assume that I would have to install the module Token for that but is it the way or is there another way?

Score: 1
Kevin avatar
View with a path of api/VERSION/foo/bar/%node - %node is not being upcast to a Node object
in flag

I am trying to create a handful of Views with a REST Export display. They have paths set behind 'api/.../.../.../%node' where %node will be an ID sent to the request to be upcasted. The basic View has a contextual filter of Content ID (excluded), and then "has any term" from this node.

However, in the contextual filter for "Taxonomy Term ID from URL" with "Load terms from the node page":

      if (($n ...
Score: 0
How to persist webform validation result in multistep ajax webform handler?
dk flag

In my AJAX form the user has to do a validation as he needs a code to enter the rest of the form (it has 3 pages or more). I have an handler to validate this and this same handler uses that code to do get a node:

  // ON the handler validate()
  $code_valid= $this->sessionManager->get('code_valid');
  
  if (empty($code_valid))
  {
     $this->handlerProperty = $this->contentService-&gt ...
Score: 0
pmagunia avatar
Module for CKEditor that provides a button to check for broken links
au flag

Are there any modules for Drupal 9 that provide a button for CKeditor that allows the user to check for broken links before saving the content?

I imagine it working like this:

  1. The user goes to a node and begins to add or edit text in a textarea
  2. After the user enters text, the user can go to the CKEditor toolbar and click a button to check links they have entered to see if they return HTTP 404 responses.
Score: -1
syter avatar
Azure web services does not remove index.php from URL
cn flag

I have a PHP-based (drupal) website running with Azure web services. It uses NGINX, and the urls are broken. The homepage is absolutely fine, but once i go to the login link (/user/login), it gives a 404. I did figure out that if you put index.php before url (/index.php/user/login), it does work. This is however not ideal. Does anybody know how to fix this?

Score: 0
sanzante avatar
How exactly does drush determine PROJECTROOT and WEBROOT for a project?
ph flag

In the Drush Configuration section of the official documentation it is said:

drush.yml files are discovered as below, in order of precedence:

  1. Drupal site folder (e.g. sites/{example.com}/drush.yml).
  2. sites/all/drush, WEBROOT/drush, or PROJECTROOT/drush.
  3. ...

There you can see "WEBROOT" and "PROJECTROOT", but there's no explanation on what they are. In the Drush code there's no mention either ap ...

Score: 0
liquidcms avatar
How can I access row field values in the parent views template?
us flag

In views-view-fields--myview.html.twig I can print a views fully formatted/rewritten field with a variable like: {{ fields.field_my_view_field.content }}.

I am wondering if there is some way to print fields in the same fashion in the parent view template: views-view--myview.html.twig. This would require having access to these variables with the sub items (row) of the {{ rows }} variable.

Is this possible? ...

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.