Latest Articles
Our latest news updates and insightful blog posts, designed to empower you with the knowledge and strategies you need to succeed.
Send woocommerce order data to and external url of Drupal
Check WooCommerce Webhook Setup
Go to WooCommerce → Settings → Advanced → Webhooks.
Make sure:
- …
Why is my godaddy email not receiving emails
How I Fixed Email Sending Issues on GoDaddy Hosting by Updating DNS Settings
If you're using GoDaddy for both hosting and domain management and your domain emails aren’t sending or being received, don’t worry—you’re not alone. I recently faced this exact problem and spent hours trying to troubleshoot. Eventually, I found a working solution that fixed the issue by adjusting the DNS settings…
How to customize the status messages in Drupal 10
In Drupal 10, to customize the status messages (such as success, warning, or error messages), you can override the message template used by the core. Drupal uses the status-messages.html.twig
file to render these messages.
1. Locate the Template
The core template file is:
core/them…
Set field value for a node programmatically in Drupal 10
To set a field value programmatically in Drupal 10, you typically load the entity (like a node, user, or taxonomy term), then set the field value, and save the entity.
Make sure the field name (field_example
) matches the machine name in your content type.
use Drupal\node\Entity\Node; // Load the node (replace with your node ID). $nid = 1; $node = Node::load($nid); if ($node) { // Set…
What is the purpose of Ctools in Drupal 9
In Drupal 9, Ctools (Chaos tools) is a suite of developer tools and APIs that provide various functionalities to enhance and simplify module development. Ctools is not specific to Drupal 9 and has been widely used in previous versions as well.
The primary purpose of Ctools is to provide a set of reusable utilities and APIs that help developers build complex and interactive features in Drupal. Some of the key features and purposes of Ctools in Drupal 9 include:
- Plugin system:…
What are the benefits of using Drupal
Drupal is a powerful and flexible open-source content management system (CMS) that offers numerous benefits for website development and management. Here are some of the key benefits of using Drupal:
- Flexibility: Drupal provides a highly flexible and extensible framework that allows developers to build websites and applications tailored to specific needs. It offers a wide range of modules, themes, and APIs, enabling the creation of custom functionalities and designs.
- Scalabi…
Using custom code disable cache from menu block in drupal 8
To disable caching for a specific menu block in Drupal 8 using custom code, you can implement the hook_block_view_alter hook in your custom module or theme. Here's an example implementation:
/** * Implements hook_block_view_alter(). */ function mymodule_block_view_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) { if ($block->getPluginId() === 'system_menu_block:my-menu') { // Disable caching for the menu block. $build['#cache']['max-age'] = 0;…
User related methods in DRUPAL 8
Get user role of current loggedin user
$user_roles = \Drupal::currentUser()->getRoles();
will return an array like:
Array
(
[0] => authenticated
[1] => administrator
[2] => some_other_role
)
Get user detail of curent loggedin user
$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id()); user_delete(uid); $user_roles = \Drupal::currentUser()->getRoles(); $user = \Drupal\user\…
Update node field value of a content type using batch process in Drupal 9
To update the text field value of a content type in Drupal 9 using a batch process, you can follow these steps:
Create a custom module: If you don't have one already, create a custom module in the 'modules/custom' directory of your Drupal installation.
Define a form to receive the user input: Create a form in your custom module that takes the new value for the text field as input from the user. This form will be used to trigger the batch process.
Implement the batch process:…
Twig Template Naming in Drupal 10 Themes
Twig templates are files with the .html.twig extension used to define the HTML structure and layout of various components in Drupal. These templates allow developers to customize the look and feel of pages, blocks, nodes, and other elements.
Drupal uses a hierarchical template naming system, making it possible to override templates for specific components, entities, or conditions. By naming templates according to conventions, you can ensure they are applied to the correct contexts.
…To remove index.php from URL in Drupal 8
By default adding /index.php/ in URL so how to remove index.php from URLs in Drupal 8
I have added the following code in .htaccess file then the issue has been resolved
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC] RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
Other method you can try to stop indexing this type of URLs in Google or other search engine
Add the following code in robots.txt
Disallow: /index.php/*
To install a module in Drupal 10 using Composer
Open a terminal and go to the root directory of your Drupal project.
cd /path/to/your/drupal-project
Use the following Composer command to download the module:
composer require drupal/module_name
Replace module_name
with the actual machine name of the module. For example, to install the Pathauto module:
composer require drupal/pathauto
This will download the module and place it inside the…