Sometimes we need to completely remove media entities, for example, when you copy a site for another project. Here are two examples.
tweaks
How override/customize/theme Drupal Views Exposed Filters form with a custom Twig template? Easy! Real working tutorial. Step by step in 5 mins.
When in front of me there was a task to make the site with specific breadcrumbs for specific pages, I applied a very simple and quick solution without the contrib modules. Just a few simple PHP lines in the custom module.
By using layout plugin we can easy to create own layouts for node add/edit forms. In this article a brief instruction on how to create a custom layout for the form.
Here is a very quick and simple example of how to create a user/administrator programmatically on any Drupal 8 website. This tweak is very useful when the client has provided a site for support but forgot or did not have the opportunity to create an admin account for you.
When you use the "pathauto" module and want to make the node's URL depends on your custom field you can create a pattern using a token, however, what can you do if the field is boolean and you want to make a human path or you needed in the more complex pattern? You can implement it programmatically. I going to show how to fix it very quickly.
This helpful article shows how programmatically restricts an access to individual pages of a site without using heavy modules and using only one field and a few lines of the code.
While Replicating Nodes using Replicate and Replicate UI Module, I found that the module will publish a node immediately after replication. What I would like is when it is replicated the replicated (cloned) node opens in edit mode so that a content manager can make the necessary changes before publishing it.
Drupal 8 & 9: Creating modal windows (pop-ups) with a form and to send a mail programmatically
Modal windows/dialog (AKA pop-ups) are great and provide a great experience for the end user - they allow for a quick display of content in an overlay without navigating to another page. Fortunately, it’s relatively straightforward to implement in Drupal 8.
Here's how to do it with an entity builder callback without any additional contrib module like "Automatic Entity Label" or "Automatic Nodetitles", using only Drupal core functionality.