Create custom style plugin for views Drupal8

I have taken the reference from views module which is now present in Drupal8 core.

Lets created custom module in which create 'simple node archive' views style plugin when installed. As Drupal8 now ships with symfony components the .info files are now .info.yml and coding syntax is changed but more similar to Drupal7.

name : simple node arvhive
description : Provide simple node archive style option for Views.
core : 8.x
package : Content display
type: module
dependencies:
  - views

No changes for .module file.

Add HTTP Authentication to a site

SSH into your server and cd (change directory) to the folder where your have .htaccess file and execute the following command.

user@user-desktop:~$ htpasswd -c .htpasswd username
New password:
Re-type new password:
Adding password for user username

if you open the .htpasswd file you can see something like this -

username:lOy81yOkKmeXc

Add/modify .htaccess file:

AuthUserFile  Path to your .htpasswd file ex: /var/www/mydrupal/.htpasswd
AuthType Basic
AuthName "Restricted Access"
Require user username

Ways to print a block Drupal

We can print block in drupal in different ways bases on block type .

Using PDO in Drupal 7

Below are the list of Sql queries used to use in Drupal coding -: