Drupal Answers Community Digest

Top new questions this week:

Require v8 only contrib module with v9 patch

Given I have Drupal 9 composer installation with composer-patches plugin and given a contrib module with a stable v8 release, but no v9 release (not even dev branch) and given that contrib module has ...

composer 9  
asked by Hudri 4 votes

What is the replacement for menu_link_load()?

Drupal 7 has menu_link_load() to load a single menu item. What is the Drupal 8 equivalent?

8 navigation  
asked by Liam Morland 2 votes
answered by Shawn Conn 2 votes

"Order items" view displaying removed items (variations)?

I'm dynamically removing items from cart with this function: static function _remove_product_variation_from_cart($variationId) { $orders = \Drupal::service('commerce_cart.cart_provider')->...

8 commerce  
asked by MilanG 2 votes
answered by No Sssweat 0 votes

Open ajax dialog with JavaScript

By adding use-ajax to a link we can open a modal using the Drupal ajax library as per the docs. E.g. <a class="use-ajax" data-dialog-options="{&quot;width&quot;:400}&...

ajax modal-dialogs  
asked by Felix Eve 2 votes
answered by 4k4 1 vote

Updating core with Composer, differences, and why --with-dependencies fails

I'm a Drupal novice and have been playing around with it for the last few months. It seems like every 'how-to' article tells you a different way and a reason not to do it the other way. I am a ...

composer  
asked by mindmischief 2 votes

Need help to find right language detection configuration

We are developing a site with 10s of thousands of nodes and 12 interface and content languages. Having spent hours trying different configurations for language detection, I cannot find one that meets ...

i18n-l10n  
asked by Edward Peters 1 vote

Some pages hide content unless "Read more" is clicked

If I have multiple pages on Drupal, some show the full page, and others say "Read more" and will only show the whole page when it is clicked. It doesn't seem to have anything to do with the ...

navigation  
asked by Mark Robbins 1 vote
answered by Beebee 0 votes

Greatest hits from previous weeks:

Check if a user has a role

How can I check if a user has a certain role? I found this but it is for Drupal 6.

7 users  
asked by giorgio79 45 votes
answered by marcvangend 88 votes

Create template file for views block

There is a lot about theming custom blocks, but what about blocks created by views? My views block has id: block-views-posts-listing-block, I try many ways for naming template file, ex: block--block-...

7 views theming 8 blocks  
asked by Codium 18 votes
answered by cigotete 18 votes

How to get each field value in views-views-unformatted--view-machine-name.html.twig?

I have an twig file: views-view-unformatted--view-machine-name.html.twig {# /** * @file * Default theme implementation to display a view of unformatted rows. * * Available variables: * - title: ...

views theming 8  
asked by Sugandh Khanna 19 votes
answered by No Sssweat 20 votes

Dynamic select list in the form (dependent dropdown)

I'm using Drupal seven. I want to make the options in a select list be dependent on the value chosen in another select list in a form. I'm sure this has been asked many times before, but I am having ...

7 ajax forms  
asked by Ben 29 votes
answered by jordojuice 27 votes

How do I get the base path?

I want to use the base path in a Drupal 8 template file. I tried the following, but I don't get the correct result. {{ app.request.baseUrl }} {{base_path}} What I need is the absolute path to the ...

theming  
asked by Yuseferi 20 votes
answered by Yuseferi 4 votes

Iterate through multiple value content field in Twig template

I need to take control over the rendering of a field_admin_tags field in a node.html.twig template. This WORKS: {{ content.field_admin_tags }} — Renders everything (label + all field values) {{ ...

theming 8  
asked by AngularChef 25 votes
answered by 4k4 19 votes

How to create test_endpoint?

I am new to drupal and I am using services module for using REST and RESTWS module. I used RESTWS and could get the content of the node by http://base_url/node/1.xml and now I need to add a node ...

7 services  
asked by sridhar 28 votes

Can you answer this question?

Content moderation - workflows / weird behavior

I have set a content moderation workflows for my content type : Draft and Published states. Pretty basic, i create a content in Draft which is not published, i can change the moderation_state to ...

8 workflows  
asked by lchabrand 1 vote
answered by Armando Silva 0 votes
You're receiving this message because you subscribed to the Drupal Answers community digest.
Unsubscribe from this community digest       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 110 William Street, 28th floor, New York, NY 10038

<3