Posts

Rohit Rajput Sahab - Celebrating 250

Image
  Celebrating 250 Module name = Next Previous Post Block (Previous/Next pagination) Module URL = https://www.drupal.org/project/nextpre My one module is crossed 250+. 250+ websites are using my module. This is a real proud moment for me. My module is useful for Drupal users and the community. I hope my module will increase day by day. Thank you to Drupal.org and Drupal users. #drupal8 #drupal9 #drupal #module

Send email when entity field value is changed

You can use Rules to achieve this. Create new rule that will react on "After updating existing content" event. Use the following conditions: data comparison:  node:field-your-field  and  node-unchanged:field-your-field  and select "Negate: FALSE" Create whichever actions you want, e.g. send mail, show message, etc.

Difference between hook_boot and hook_init Drupal

HOOK_BOOT Even cached page executes this hook This hook is called before modules or most include files are loaded into memory. It happens while Drupal is still in bootstrap mode. HOOK_INIT Cached page doesn’t run this hook. When this hook is called, all modules are already loaded in memory. It happens after bootstrap mode.

Use of template.php

The template.php file contains your sub-theme's functions to manipulate Drupal's default markup. It is one of the most useful files when creating or modifying Drupal themes. With this file you can do three things: Modify any theme hooks variables or add your own variables, using preprocess or process functions. Override any theme function. That is, replace a module's default theme function with one you write. Call  hook_ * _alter ( )  functions which allow you to alter various parts of Drupal's internals, including the render elements in forms. The most useful of which include  hook_form_alter ( ) ,  hook_form_FORM_ID_alter ( ) , and  hook_page_alter ( ) . See  api.drupal.org  for more information about _alter functions.

Install Varnish in Drupal 7

Learn Installation of Varnish Cache Server for Drupal 7 in few Steps.  1. Update Apt-get  sudo apt-get update 2.Install Varnish  sudo apt-get install varnish 3.Edit your Varnish Page sudo vi /etc/default/varnish Add this to the top of the file to start varnishd at boot: START=yes Then look for these settings and edit to match: DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,128M" 4. Now Edit ports.conf file  sudo vi /etc/apache2/ports.conf Update settings to match: NameVirtualHost *:8080 Listen 8080 4. Also Edit default file sudo vi /etc/apache2/sites-availbable/default Update settings to match: <VirtualHost *:8080> 5. Restart Apache2 and Varnish Servers sudo service apache2 restart sudo service varnish restart 6. Update default.vcl file  sudo vi /etc/varnish/default.vcl backend default { .host = "127.0.0.1"; .port = ...

How to create custom module in Drupal 8

In Drupal 8, we should keep the custom or contributed modules under modules folder in the root directory. First of all I am going to create a folder for custom module that is "Custom Module" with a machine name of custom_module. Start the module by creating a folder within the Drupal installation and path is: /modules/custom/custom_module or /sites/all/modules/custom/custom_module. custom_module.info.yml  : Now Creating the "custom_module.info.yml" in the root of the custom_module directory. 1. File: modules/custom/custom_module/custom_module.info.yml: File: modules/custom/custom_module/custom_module.info. yml:  name: My custom module name description: Creates a page showing "Hello World" . package: Custom type: module core: 8 .x 2. File: modules/custom/custom_module/custom_module.module: This file is required but can be empty. <?php /**  * @file  * Hello module.  */ 3. File: modules/custom/custom_module/custom_module...

Difference between DBMS and RDBMS?

No. DBMS RDBMS 1) DBMS applications store  data as file . RDBMS applications store  data in a tabular form . 2) In DBMS, data is generally stored in either a hierarchical form or a navigational form. In RDBMS, the tables have an identifier called primary key and the data values are stored in the form of tables. 3) Normalization is not  present in DBMS. Normalization is  present in RDBMS. 4) DBMS does  not apply any security  with regards to data manipulation. RDBMS  defines the integrity constraint  for the purpose of ACID (Atomocity, Consistency, Isolation and Durability) property. 5) DBMS uses file system to store data, so there will be  no relation between the tables . in RDBMS, data values are stored in the form of tables, so a  relationship  between these data values will be stored in the form of a table as well. 6) DBMS has to provide some uniform methods to access the stored information. RDBMS system supports a tabula...