Using if $nid is equal to added so add noindex in head tag for this we can using theme_preprocess_html() hook. function example_theme_th...
Using Drupal Hook you can hide and disble any field from Drupal frontend using below code snippet: Below code add on any drupal custom code ...
Core Drupal 8 modules for web services Serialization :- The Serialization module serializes and deserializes your Drupal website data to and...
Simple snippet on how to create users programmatically in Drupal 8 and Drupal 9 just add the following code inside a function where you wan...
This article shows you how to create Token Drupal to return absolute URL and image URL path of article content type content without langua...
The code snippet that can use to disable cache for a specific page in drupal 8. Disable cache for a specific content type Example: <?ph...
This is a more detailed version of the Update Instructions directly above this section and assumes drush is installed. Always take a ...
Drupal 8 has adopted Symfony as a part of its core. It uses Symfony kernel and events to do the same now. The list of kernel events availa...
I used the following hook_form_alter code to add a token: use Drupal\Component\Utility\Html; /** * Implements hook_form_alter(). ...
Drupal's database API provides abstraction using PDO to provide support for multiple types of data...
To enable `Twig Debug Mode`: If `sites/default/services.yml` exists proceed to the next step. Otherwise copy `sites/default/default.servi...
The Solution is very simple now we have implemented a module there you can set 5 min and one min whatever time you want to be set you can ...
Example 1 Create mymodule.module file /** * Implements hook_theme() to add the template definition. **/ function mymodule_theme(...