Drupal Answers Community Digest

Top new questions this week:

Navigate to next page / previous page based on entity reference field instead of Book module

I am trying to create next/previous page links like the Book module. I have two content types, Chapter and Page. The Chapter content type contains an entity reference field (unlimited) for pages. ...

asked by Patrick Kenny 3 votes
answered by No Sssweat 3 votes

How do I force config overrides to refresh?

I've setup a system of dynamic config overrides using a service tagged with config.factory.override. This override overrides the system.site name configuration. I have a form that upon submission ...

8 configuration  
asked by Jaypan 3 votes

Understanding Trusted Hosts

I got the "trusted host settings" error, which reads: The trusted_host_patterns setting is not configured in settings.php. This can lead to security vulnerabilities. It is highly recommended that you ...

asked by glenviewjeff 2 votes
answered by glenviewjeff 4 votes

How can I design the standard user login form with twig?

I want to change the labels "Username" and "Password" and delete "Create new account" link of the standard login form of Drupal 8. Is it possible to do this with twig?

asked by Universaldenker 1 vote
answered by Gogowitsch 2 votes

File (Field) Path settings to rename multiple images with their alt or title

The module File (Field) Path allows me quite nice to rename a single image file with its "alt" or "title". But if allow the image field to accept multiple downloads, I cannot get the individual ...

8 files tokens  
asked by Benjamin 1 vote

Add a "Save" action in local task to a node

I would like to add a new action to local task on node. This new action has to save the current node. I have drupal 8.8.0 I know how to add a new action. But my question is about how to save the ...

asked by Benoit 1 vote

What's the difference between web service (API) implementation with REST and routing?

what are the real differences between these two methods of creating a webservice : Routing + Controller (https://www.chapterthree.com/blog/custom-restful-api-drupal-8) REST plugin ...

asked by Hasina Njaratin 1 vote
answered by Marwen Amri 2 votes

Greatest hits from previous weeks:

Programatically render a block in a twig template

I need to render a views block in my page.html.twig template. In D7 I would do this: <?php $block = module_invoke('module_name', 'block_view', 'block_delta'); print render($block['content']); ...

blocks 8  
asked by Rick Bergmann 28 votes
answered by Berdir 48 votes

How do I add a custom validation handler to an existing form/field?

How do I add a custom validation handler to an existing form (or form field) in Drupal 8? I have a form that I haven't created. I want to add my own validation rules on some fields when the form is ...

8 forms  
asked by AngularChef 25 votes
answered by Shabir A. 20 votes

How should I implement hook_menu()?

What are the fundamentals of implementing hook_menu()? I would like to see the basics covered in a single question, to avoid having to answer the same similar but different questions over and over.

7 routes  
asked by Letharion 103 votes
answered by Letharion 148 votes

Programmatically create a user and assign a role

I'm programmatically creating a user with the following code. $newUser = array( 'name' => $mail, 'pass' => 'password', // note: do not md5 the password 'mail' => $mail, 'status' ...

7 users  
asked by Nicola Peluchetti 47 votes
answered by Nebojsa 47 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
answered by Ajinkya Kulkarni 56 votes

Problem installing in local "The translation server is offline"

I'm trying to install Drupal 8 on my laptop (localhost on a WAMP server), and I always get the following error in the first steps: Requirements problem The translation server is offline. ...

asked by vicenteherrera 5 votes
answered by rpayanm 17 votes

How do I remove duplicates when using the random sort?

I have created a view where I am displaying the the node title and a logo (a cck field). In the arguments I have passed the taxonomy term name. In the result a node is displaying 2 or 3 times; I ...

asked by Ahmad 30 votes
answered by Sithu 19 votes

Can you answer these questions?

twig template suggestion for comment reply form

there is no template suggestion for a comment reply form in Drupal 8, how can i create one? i am not talking about the reply form displayed in the node for which Drupal suggest a template : ...

theming comments  
asked by octogone.dev 1 vote
answered by leymannx 0 votes

Form alter + Unlimited Values + Entity Reference Field

There are two fields, News Type (Selectbox), News (Reference Entities, Unlimited option, autocomplete) When user select a news type, options of News fields needs to revised. Example: Selecting World ...

forms ajax  
asked by Techd 1 vote

Unable to restore from backup created from Backup and Migrate module

I used the Backup and Migrate to create a full site backup that generated a tar.gz file that is just over 300MB. When I attempted to restore my site with this back up through the Backup and Migrate ...

migration backups  
asked by TheSnowboardingDev 1 vote
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