Latest Drupal related questions

Score: 0
If content not published, hide also for admin
kn flag

I have a entity browser which list my produts. The products are shown only if they are published.

enter image description here

But for some reason, if the product was added before the filtered "publish" was set, the product is still displayed but only for the admin.

How can I prevent the admin to see it ?

EDIT :

For now, I've added a manual check in twig, but i think there's a cleaner way to do it

{% for produit in produits %} ...
Score: 0
Get a term name with twig_tweak drupal_field using a dynamic value
cl flag

I'm using Webform in D9 and have a multipage form. In step 2 of the form, I need to show the taxonomy term that was selected in step 1.

I've defined the field that will display it as a computed twig field.

If I simply use

{{ data.my_field }}

I get back the tid.

If I instead put

{{ drupal_field('name', 'taxonomy_term', <tid> }}

I receive the desired text. However, I need the tid to come from t ...

Score: 0
Metatag cached, cannot change it
it flag
MMT

I'm running a D7 with the Metatag module 7.x-1.28, no other Metatag modules are enabled.

On my front page node I: a) changed the metatag description from the old text to a new description text. b) in the metatag config at admin/config/search/metatags I have also changed for the FrontPage the description of the metatag to the same new description text.

The problem is that despite the many actions tha ...

Score: 2
yuuuu avatar
Is there a way to add a page element to all unpublished pages?
ao flag

I am trying to add an "unpublished" graphic on all content that is unpublished so editors can clearly see that the page is unpublished, but I have about 15 different content types.

Is there a way I can add this to all content easily with twig templates or otherwise?

Score: 0
How to add multiple html tables in one view or page
kp flag

I created, 4 tables with the datatables module, but I need to leave the 4 in a single page or view, I tried with dashboards and with draggable dashboards, but they only work on the administrator side I tried with blocks and other options but I can not publish these tables and that these can be filtered in a single page, someone knows how would be the right way to do this.

Thanks for your answers

 ...
Score: 1
"JSON Web Authentication (JWT)" module support for 3rd party JTW issuer
es flag

Does Drupal "JSON Web Authentication (JWT)" module support authenticating JWTs generated by a 3rd party JWT Issuer (rather than by the internal module's Issuer)?

Score: 0
How can I programmatically insert data (rows) to a custom entity table?
us flag

I am using Drupal 9 and I am somewhat of a newbie.

I have created a custom entity into which I wish to log the date and number of image downloads. I can use the entity's form to create entries but I need to do it programmatically, when the user triggers a download action from the site. The only thing known at that point is the user id and the number of images in the download. How do I tell my mod ...

Score: 0
phep avatar
CSS, JS, ... not created by drush site:install
gq flag

Drupal installation is failing after the following steps on a Debian box (database is already created and privileges granted to specific user):

(user) $ composer create-project drupal/recommended-project myproject
# ... ask if it is OK to install composer/installers, drupal/core-composer-scaffold and drupal/core-project-message, answer Yes 
# ... emits 2 warnings about doctrine/reflection and webmo ...
Score: 0
Actual file permisions
do flag

With Drupal 8/9 I want to:

  1. Have a private file folder
  2. Upload files to it (ideally by whatever method but media type will do)
  3. Allow only authenticated users (ideally set by role) to view the file (whether by direct link or link in WYSIWYG editor)

Why does this seem to be so hard? Am I missing something?

When I set up private files using the online documentation I can find it either blocks everyone but  ...

Score: -2
Raja Chakraborty avatar
How can i redirect to a separate page without filling value in the required field?
in flag

I have a site in drupal 9. I have one taxonomy with the name and and another field. I have a Go back button which takes me to a separate destination. The problem is that I cant click go back without giving some values in the name field as it is by default a required field in drupal. I want to click go back without giving anything in that name field. How can i achieve this?

Score: 0
SomebodySysop avatar
How to add checkbox using hook_field_widget_WIDGET_TYPE_form_alter()
gb flag

Running Drupal 9 with paragraphs module, paragraphs collapsible and paragraphs jquery ui accordion installed. I wish to modify paragraphs' form, specifically where it displays private files by adding a 'Switch to Public' checkbox under each file description (see attached image).

I am using hook_field_widget_WIDGET_TYPE_form_alter(). Here is example code:

**
 * Implements hook_field_widget_WIDGET_TYP ...
Score: 0
Joseph avatar
How would one make a variable in a module's JS editable via admin menu?
cn flag

Say I have a library that is attached to a page that brings along with it some JavaScript. For this example, let's say the JavaScript has a variable which is the path to an image that the JS displays. This would look something like:

variable.setAttribute('src', drupalSettings.path.baseUrl + pathToPicture)

Now let's say I want to have pathToPicture configurable via Admin Menu so that one may add t ...

Score: 0
pglatz avatar
how to install drush 10 concurrently with 8?
in flag

I'm having some questions about installing the latest drush, and the more I search, the more conflicting advice am I getting. I need both drush 8 and 10, since I am testing both Drupal 7 and 9. I had installed drush 8 a while back as a standalone in /usr/local/bin/drush8. But I can't figure out how to create a similar standalone version of 10 (one that would be moved to /usr/local/bin/drush10). I'm usin ...

Score: 0
Why isn't the template file used?
cn flag

I have created a template. Its file name is exactly as specified by the file name suggestions. However, the template is not used. In the screenshot you can see the suggestion for the file name, exactly so is the template.

In the theme I have all possible templates, which all work. Only this one does not work.

Could the filename be too long? I can't get the filename before the extension shorter than  ...

Score: 1
sonfd avatar
Why might a batch initiated in hook_install() sometimes not process?
in flag

I have two modules, module_alpha and module_beta.

Both modules install a database table with hook_schema() which they use to track information about published nodes. Data is logged in the table with service methods executed from hook_node_insert() and hook_node_update() hooks. This all works.

But, I need to process all existing nodes when the module is installed to backfill the custom tables with inf ...

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.