Sometimes we need to completely remove paragraphs entities, for example, when you copy a site for another project. Here are two examples.
D10
Sometimes we need to completely remove media entities, for example, when you copy a site for another project. Here are two examples.
How override/customize/theme Drupal Views Exposed Filters form with a custom Twig template? Easy! Real working tutorial. Step by step in 5 mins.
Drupal 10: A custom validator for checking Start time field depending on the value of End Time
In one project I use two independent date fields "Start Time" and "End Time". Both fields are optional, indecencies and don't know about each other. However, if "End Time" is selected, I need to check "Start Time" and display a message, so the first field shouldn't be empty and "End Time" should be greater or equal. This code shows a solution how to implement.
Working on one project for the KWALL company, we needed to sort the list of TV programs/events by time ignoring the date. We have created a custom views sort plugin for it.
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.
Drupal 10: A custom validator for checking the field depending on the value of another field
In one project I use two independent date fields "Start Date" and "End Date". Both fields are optional. But if "End Date" is selected, I need to check "Start Date", so the first field shouldn't be empty and "End Date" should be greater or equal. This code shows how I implemented the solution.
The solution can be helpful, for example, in case, if you received the mail and see that only one module was updated and this module uses on admin interface only and nothing critical for the visitors and updating can wait. So you shouldn't spend time in opening the site for checking.
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.