Latest Drupal related questions

Score: 0
turpentyne avatar
How to list content that references another content type through paragraphs
tr flag

I have two content types: "Author" and "Document." The Document content type uses a Paragraph "Author_citation" to connect the two and display all the authors (plus other fields) that worked on that Document in a block. This works fine.

I also want to show a block - on the "Author" page - listing documents connected to that author, through the paragraph.

I know I've seen a way in the past to pull th ...

Score: 0
Private File Permissions Not Working for a Single file - Can't Identify where to find error
rs flag

I have the following set up:

  • Private file field configured on content type
  • Access control configured with referenced user having permission to view file
  • If user is referenced on the node, they can view the private file of that node.

Here is the issue that I am having:

  • A specific file could not be loaded. Drupal Redirects as if the user does not have proper permissions to view the file.
  • Other file ...
Score: 0
How to get the user info on who deleted an account?
ar flag

In Drupal 7, a user was removed. As an administrator I reviewed the permission and role report from administration menu. But couldn't find the information. Is there any other way I can find the info on who has deleted the user? Is this information stored in database table? If so how can I get it?

Thanks Venkat.

Score: 0
pglatz avatar
How to render a view in a custom twig template?
in flag

I created a custom twig template to override views-view-fields in an unformatted view. What I would like to do is get rid of the rendering loop and explicitly display the variables in certain positions. I used dump() to list the variables, and am seeing a list like

  'field_pf_site_url' => 
    object(Drupal\views\Plugin\views\field\EntityField)[4373]
      ...
  'title' => 
    object(Drupal ...
Score: 0
How do I get the type of a "Custom block" entity?
ve flag

I created two custom block types.

screenshot

How do I retrieve the type of custom block in hook_theme_suggestions_block_alter()?

function mytheme_theme_suggestions_block_alter(array &$suggestions, array $variables) {
  if (isset($variables['elements']['content']['#block_content'])) {
    // $variables['elements']['content']['#block_content']->getEntityTypeId() returns 'block_content'. 
  }
}
Score: 0
Baud avatar
How to theme a paragraph form
sa flag

I would like to create a twig template for the form displayed inside the paragraph widget.

The only way I found is:

function mymodule_field_widget_paragraphs_form_alter(&$element, &$form_state, $context) {
// Check that the subform is opened  
if (count($element['subform']) > 2) {
    $element['subform']['#theme'][] = 'form__aw_calculator';
  }
...
}

After that, I have created a twig template  ...

Score: 0
May  avatar
Drupal autocomplete jquery UI theming?
zw flag

I am using search autocomplete which uses the core autocomplete which uses jquery to position the autocomplete form.

The html output is along the lines of

<div class="ui-menu ui-autocomplete autocomplete-search" style="top: 500px;left: 10px;width: 200px;>

I beleive these inline styles are generated via jquery. However they are positioning the autocomplete form incorrectly.

Without editing co ...

Score: -1
mauzilla avatar
HTML not rendered in text field content type
cn flag

In my content type, I have a text field that will display a string (max 200 characters) in a Bootstrap card. Due to the design, we have to allow the user to add a < br /> or \ n to add "invisible lines" to ensure content is wrapped correctly in the card.

By adding "< br /> to the field however, in twig, the < br /> is printed to screen and not HTML rendered. I have tried:

<p>{{ ...
Score: 0
Madam Adam avatar
Referencing media from theme settings and display it on front page
mx flag

In a custom subtheme of classy base theme, I made a theme setting for referencing an image media file. Contents of file theme-settings.php:

<?php
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Theme\ThemeSettings;
use Drupal\system\Form\ThemeSettingsForm;
use Drupal\Core\Form;
function mytheme_form_system_theme_settings_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state ...
Score: 0
Add prefix on tables break my site
ru flag

I have an old site on an old shared server which used an old shared PHP 5 we can not update. I create a copy of this website which will run on a different (and dedicated) server with PHP 5.6 and present the contents in a API with the module RESTFUL (which need PHP 5.5.9 minimally to work). This copy will be used only to expose the content in the API. The old website will still be used to add contents. S ...

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.