This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

How to create TWIG templates in a custom module for Drupal ?

I created a custom module for Drupal 8.9

I have the Drupal Commerce and Group modules.

I want to create 3 pages and use TWIG templates :

  • /user/ID/tasks
  • /srore/ID/tasks
  • /group/ID/tasks

I want to create a template by type of group and store. How can I do this ?

My module is certainly full of errors.

With my code, the pages are well created, but the TWIG is not rendered.

task_notify.routing.yml

Why am I getting nodes that have been deleted in the array returned by node->fieldName->getValue()?

In the snippet below, I'm trying to get all of the donations content type for the current page so I can iterate over some information on each of them.  However, when I use var_dump on the array containing all of these donations that I want, it shows an array with 57 donations, when I only have 3.  

Presumably, it is no coincidence that the first 54 donations look like this:

[0]=> array(3) { 
  ["target_id"]=> string(2) "25" 
  ["_attributes"]=> array(0) { } 
  ["_loaded"]=> bool(false) 
}

and the last 3 look like:

How to give the rights to the user to see his page ?

I created a page view with a context filter to allow only current users who can administer their account to see this page (the screenshot).

I prefer to create a custom module to rewrite the view. But when I go to my page, I get a 403 error.

What's wrong with my permission ?

enter image description here

task_notify.routing.yml

How to create pages with the identifier of the entity ?

I just started a custom module (Drupal 8.9) and I use the following modules on my site :

https://www.drupal.org/project/commerce

https://www.drupal.org/project/group

How to create 3 pages in 3 different entity:

Layout Builder : clone page layout, reorder sections...

Hi,

I am developping a module which adds "advanced actions" to the new Drupal 8 Layout Builder.

For example, cloning a page layout into another, reordering sections inside a page layout, etc. For the moment i essentially use custom database queries in order to achieve this, and this is working quite well (despite the fact that this probably is not the correct way to do this).

How set Media library widget to display table-style as default?

Hi Drupal Community,

I spent couple of hours to find a way to set table-style as default display of Media library when the field widget modal is opening with 'File' as media-type, but no luck. It always opens with 'Grid' style.

Can anyone give me some advises how to do that? Should I use viewsview hook to override the Media Library view?

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions