Latest Drupal related questions

Score: 0
Hefi avatar
How do i list all child terms that share the same parent term? But on "child term" page?
et flag

Let's say I have the following taxonomy (a 3-level hierarchy).

  • Acura
    • Integra
      • Hatchback 1991
      • Hatchback 1995
      • Hatchback 2000

If I am on the last term of this hierarchy, for example Hatchback 1991, how do I display all other specific models that belong to its parent (Hatchback 1995 and Hatchback 2000)?

Probably Taxonomy Term Siblings.

Score: 0
John Machado avatar
Media Library results filtered by user
in flag

I am working on a project that will be using 100's users and potentially thousands of users. The users will be required to upload at the very least 5 images and possibly some PDF files.

Created a content type, and added some Media fields, which works perfect for this project. The user files uploaded will be all public but the issue is that when the user goes to browse for their files all files fr ...

Score: 1
Link in URL field to Media File
in flag

Before the Update to the latest DruPal 8, we were able to link to public://foo/bar.pdf to a file which was in /sites/default/files/. No the public:// prefix does not work anymore in the URL input field.

We are still able to enter the full link, but this might have the downside that it needs to be updated when the file name changes.

error

We also tried /media/1337 but it shows a new page with the download ...

Score: 1
Mathew Dony avatar
Use path alias as contextual filter
cn flag

I have nodes in Drupal for News Articles that generates this automatic URL alias.

screenshot

I also have a view for News nodes.

screenshot

This is the data.

screenshot

The problem is that I can't use Content: Path (url) or Content: Path (Path) as contextual filter.

sync/newslist/1234, where 1234 is node ID, works. I would like to pass the path or the URL to the contextual filter, so that sync/newslist/world-first-chart-alert ...

Score: 0
Rubix05 avatar
Render a fulltext exposed search bar separate from the rest of the filters
cn flag

I would like to render my exposed fulltext search bar in a separate location from the rest of my search filters. My other exposed search filters are things like display number, sort order, etc... I am also using facets.

My current problem is that I need to render the search bar in a whole separate region from the rest of my exposed filters. My current solution is to render {{ exposed }} twice but then u ...

Score: -2
Frédéric Hébert avatar
Conditional JavaScript based on URL value
us flag

I have a single form I need to insert twice in two pages by template. I have to put different values in the list selection field in the active page by the URL.

With a JavaScript field, I want to put the URL value in a conditional field.

How can I achieve this?

Score: 1
PROMES avatar
routing for dynamic block for custom entity
co flag

For a custom entity I have created several dynamic blocks. But the blocks are not displayed. They are placed in admin/structure/block. Below is an example of block 1.

myentity.routing.yml:

myentity.blocks:
  path: '/collection/{myentity}'
  defaults:
    _title: 'Stuff collection'
  requirements:
    _permission: 'access content'
    myentity: \d+
  options:
    parameters:
      myentity:
        typ ...
Score: 0
João Mateus avatar
check if a page has been redirected and then add a class to a certain div
ms flag

Im using the redirect module to redirect /page/scheduling to /page.

I need to check if the user arrived to a certain page by this redirect.

by checking this i will then add a class to a certain div.

How can I accomplish this?

Score: 0
Debugging anonymous session regarding cookie specific page caching
cn flag

Have been following this guide to make caching depend on the value of a specific cookie:

https://cornel.co/article/page-cache-cookiesor-anything-available-http-request-d9

However, it does not seem to work for anonymous users.

Debugging (xdebug) within both

src/StackMiddleware/CookiesPageCache.php

src/CookiesPageCacheServiceProvider.php

is possible when logged in as admin and running "cache rebuild"  ...

Score: 0
khaled alsamman avatar
display paragraph field in a view
cn flag

I am trying to display my paragraph bundle fields in a view. is that possible?

I have a bundle that contains 2 fields with no input limit. I want to display one of the fields in a view. I added a relationship of type Paragraph to my view and then added the "field_Description" to the view fields. Unfortunately it didn't work.

enter image description here

view img

In more detail, I have a bundle A in bundle B, I want to target bundle  ...

Score: 0
Bass-Ninja avatar
Programmatically create result row in views
ru flag

I have created a bunch of content types. Since I am using Drupal only for displaying results fetched from another service I was wondering if there is a way to display results in a view without actually having objects in the database?

For example, I get data from a certain endpoint and I want to display them in a table view. Is there a way to achieve that or would another approach be recommended?

 ...
Score: -4
Basic Page - anchor link with id
es flag

I'm trying to create an anchor link on a basic page back to the previous NON basic page to where the user came from.

I.e. <a class="btn" href="/dashboard">Back>/a> obviously works.

BUT <a class="btn" href="/startups/{{startup.id|startup_id}}/videos">Back</a> doesn't.

Any ideas as to how to resolve this would be greatly appreciated.

Score: 0
Free Radical avatar
How can I get a multivalue field correctly inserted?
kz flag

I have a custom module that creates a field type. It is a plain text field abd I've added it to a content type using the Drupal UI. The cardinality of this field is "Unlimited".

This is how I create the field in code:

class MyItem extends FieldItemBase {

  /**
   * {@inheritdoc}
   */
  public static function schema(FieldStorageDefinitionInterface $field_definition) {
    return [
      'columns ...
Score: -3
Prashant Chauhan avatar
How can we use \Drupal class inside Settings.php
cn flag

How can we use \Drupal class inside the Settings.php file so that we can load configurations etc? For example:

\Drupal::config('system.site')->get('slogan');

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.