Latest Drupal related questions

Score: 1
shelane avatar
How can I enforce a default machine name prefix?
cn flag

We require site administrators to create new webforms with the machine name beginning with site_. (This is because config ignore is set to ignore webform.webform.site_* for user generated forms while other forms are part of config) How do you validate and set the webform machine name to begin with this prefix value?

Score: 0
hotwebmatter avatar
Views Jump Menu containing only sibling taxonomy terms
nr flag

I'm using Views Jump Menu with Drupal 9.

Nodes are tagged with a software_version hierarchical taxonomy, following this pattern:

├── foo
│   ├── 0.1.0
│   └── 0.2.0
├── bar
│   ├── 0.3.0
│   ├── 0.3.1
│   └── 0.4.0
└── baz
    ├── 0.1.0
    ├── 0.2.0
    └── 0.3.0

The plan is for nodes of a custom Content Type to  ...

Score: 0
Passed variable is not an array or object
cn flag

Trying to migrate images by copying them from an external source:

id: custom_news_migration_with_external_images_1
label: custom news migration with external images importer
source:
  plugin: embedded_data
  ids:
    id:
      type: integer
  constants: file_destination: /home/ip/c921/web/sites/default/files/images #absolute path ... default 'public://images'
process:
  nid: id
  title: title
  fie ...
Score: 0
awm avatar
Create cache context for anonymous users based on ip range
mx flag
awm

I have a form within a custom block that is displayed on the front page of a Drupal 9 site on Acquia Cloud. I want to be able to have different displays for users coming from certain ip ranges. Is this possible to do while leaving all Drupal caching such as dynamic page cache and internal page cache?

If it is possible, how do I create cache contexts for this custom block/form such that Drupal kno ...

Score: 2
metalac avatar
Need to add multiple roles to routing.yml file
us flag

I want to assign multiple roles in my routing.yml file :

requirements: _role: "['role1', 'role2', 'role3']"

This is what I currently have, and it doesn't work.

Can someone tell me how to add this?

Thanks in advance!

Score: 0
Asatur Vardanyan avatar
Feeds: Import JSON nested fields
jp flag

I am using feeds and feeds_ex modules, and JSON Path parser to import data from the endpoint. Here is imported data:

{
  "products": [
    {
        "id": 103839858696,
        "title": "\"Apt to get all Opportunities\": White Pennsylvania Runaways, 1750-1762",     
        "tags": "gpc used book, used book",                   
        "image": {
            "id": 554766794760,        
             ...
Score: 0
Andrew Perriman avatar
How do I set up a views block that filters contextually on a field included in a paragraph?
in flag

I have two content types (ContentA, ContentB) which both use the same paragraph (MyParagraph) as field type “Entity reference revisions.”

MyParagraph consists of two “List (text)” fields: ParagraphFieldA, ParagraphFieldB.

The values for ParagraphFieldA and ParagraphFieldB come in both cases from allowed values lists which have a key and label.

ContentA is limited to one MyParagraph reference bu ...

Score: 0
bigboy avatar
Node url alias pattern based on taxonomy not working properly
gu flag

I have taxonomy named Category with two terms: News and Articles.

Articles term has custom url alias - /useful.

The website was upgaded from D7 to D9. On old D7 version node url pattern was [node:field_categories]/[node:title]

On D9 it is the same pattern, BUT instead of /useful/node-title it dispalays /articles/node-title

Maybe it is not a big deal, but after porting to D9 I would like to maintain curr ...

Score: 0
how to add javascript to an article?
cn flag

just installed a stock Drupal 9.2.2 core, trying to create an article with the /node/add/article editor, how do i add javascript to the article? enter image description here

Score: 0
How to import content with multiple taxonomy terms with translations?
kr flag

I have a CSV file like this.

id,Title,body,tags,dutch title,dutch body,dutch tags
1,Content1,Description,tag1;tag2,Dutch Content1,Dutch Description,dutch tag1;dutch tag2

I have the migration file for English like this:

id: my_migration
label: My migration
migration_tags:
  - my_migration
  - node
  - company_guide_import
source:
  plugin: csv
  delimiter: ','
  enclosure: '"'
  escape: '`'
  head ...
Score: 0
kazah avatar
How to change the display order of webform elements (conditional logic)?
aq flag

How to change order (weight) of webform elements in conditional logic based on the visibility of other elements?

My webform example, six fields:

  1. Open field A? (Checkbox yes/no)

  2. Field A is hidden (textfield, hidden because current-page-node-field-a is null)

  3. Open field B? (Checkbox yes/no)

  4. Field B is hidden (textfield, hidden because current-page-node-field-b is null)

  5. Open field C? (Checkbox ye ...

Score: 0
Joost avatar
I'm not able to fully disable caching during development
jp flag

I'm currently developing a new Drupal 9 website. I build quite a few custom modules for this but for some reason the changes I make in the modules during development are not visible immediately.

I disabled caching as described in this post.

The strange thing is that, even when I run drush cr the changes are not active. I also have my chrome development window open so the browser is not caching the pages  ...

Score: 0
beltouche avatar
How to add a secondary Ajax submit to a regular node form?
cn flag

I'm trying to add an Ajax submit to a regular node edit form (Drupal 9). I'm using Field Groups so that there's a series of tabs, and I've added a pair of "buttons" (Right now they're just markup <div>s, but I could change them to real buttons if that's recommended) that users can use to move forward and back through the tabs with some Javascript.

The ask now is that each time the tab focus change ...

Score: 2
Kevin avatar
Debugging "UNCACHEABLE" header
in flag

We have a site where the homepage is not being cached and contains the headers:

x-cache: MISS, MISS
x-cache-hits: 0, 0
x-content-type-options: nosniff
x-drupal-dynamic-cache: UNCACHEABLE

I narrowed this down to the content regions contents, and disabled the "Main page content" for the front page. This then gave me a cache HIT, and no longer responded as UNCACHEABLE. From there, I narrowed it down to a  ...

Score: 0
How to save contextual filters (taxonomy) used with one content type to another?
mg flag

I'm quite new to Drupal and I'm building a site where the user will be able to filter content using taxonomy (for example location, price range free/cheap/expensive,etc.). I want this filter to be kept between pages, from a global view to a specific content and even for different types of content.

Example : User selects a place, a price range. The view is updated with proposed activities. User op ...

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.