Blog
How to make core version drupal 9 compatibe in module .info file
Make sure to edit the .info file to make your module compatible with drupal 8 & 9.
Blog
Delete users that never logged in in drupal 8
An important clean-up task on bigger websites is to remove unused accounts. This snippet does the work.
Blog
Blog
Get route of a views page with drupal console
I like drupal console a lot as a helper tool for development. In this snippet I wanted to get the route of a views page. The page is on /news-events.
Blog
Blog
Give only custom block access but not block overview in drupal 8
Personally I do not like giving block access to website editors. In this one case, there was a need to edit custom blocks. I granted access to administer blocks, but I blocked access to the overview page with this EventSubscriber.
Blog
Get current user role in drupal 8 or 9
Getting the current user role in code is quite easy, here's the snippet.
Blog
Blog
Apply patch in composer without updating other modules
Patching workflow in drupal is something you need to learn a bit. I stumbled on a few cases where I would have to update one module only and want to prevent from updating the entire system. Here's the snippet
Blog
Log messages in drupal 8 & 9
Loggin is very important. These snippets need to be used, be as precise as possible.
Pagination
- Previous page
- Page 21
- Next page