I am using the following code in the templates of the home page of my site, to make the display mode frontpage_tasks for the current user's account. It works perfectly :
{{ drupal_entity('user', user.id, 'frontpage_tasks') }}
I want to make the same display mode for the current user's stores and groups. I tried the code below but it doesn't work :
{{ drupal_entity('commerce_store', user.id, 'frontpage_tasks') }}
and
{{ drupal_entity('group', user.id, 'frontpage_tasks') }}
How do I make the current user's entities on the home page ?
Comments
Comment #2
chi commentedI do not understand what you are trying to achive. The first argument of of the
drupal_entity()is entity type while the second argument is ID of a particular entity of that type. So if you specify 'commerce_store' as the fist argument you should provide ID of some commerce store for the second argument.Comment #3
zenimagine commentedOK, so it is not possible to show all stores and groups of the current user on the homepage with Twig Tweak ?
Comment #4
chi commentedRight. That should be possible with Views module.
Comment #5
zenimagine commentedThe problem is that the Views module adds a lot of unnecessary markup that makes it impossible to display it correctly.
I just want to make the display mode, without any additional tags
Comment #6
chi commentedThen build that list in preprocess yourself. Maybe Commerce module provides some API function for that.
Comment #7
zenimagine commentedok thank you
Comment #8
zenimagine commented