Skip to main content

Posts

How to configure Drupal7, varnish, authcache2 and ESI in Nginx server?

This is step by step procedure for, how to configure the authcache, varnih and ESI for the drupal7 project in NGINX erver. To configuring the Nginx Server use the procedure from document " http://www.geoffstratton.com/2014/03/nginx-php-fpm-apc-ssl-drupal/ " Well, make sure your nginx server is up and running. 1.Configuring the Authcache module.      Download the module from https://www.drupal.org/project/authcache    Enable only the authcache module    Go to admin/reports/status , then you can see the Authcache area is red and saying that there is no back end has been configured.   2.Configure Varnish on the back-end[nginx server].     Using the Following commands,       $ curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add -     $ echo "deb http://repo.varnish-cache.org/ubuntu/ precise varnish-3.0" | sudo tee -a /etc/apt/sources.list     $ sudo apt-get update ...

How to enable clean URL for Drupal 8 in NGINX server?[Drupal 8 + NGINX + Clean url + Drupal7]

Well I was wondering from last couple of hours how to enable the clean url for drupal8 in my local nginx server. It is also works for drupal 7. Its very simple do edit the " /etc/nginx/sites-available/default " , Please type the following command on terminal. $ sudo gedit /etc/nginx/sites-available/default And search for the line text " try_files $uri $uri/ =404 " under location/ server configuration area and comment it . Then add these lines to below that, as like              location/ {                ..........                ............                #try_files $uri $uri/ =404; <============= You need to comment this line                expires max;        try_files $uri $uri/ @rewrite;               ...

How to create a custom module in Drupal8 PSR-4? (Hello world module in Drupal 8)

Steps to create a custom module in Drupal8.  Step 1: File Structure.   In Drupal8 we should keep the Custom module or contributed modules under modules folder on the root directory.   modules/contrib/   modules/custom/   Note:- multisite configuration         sites/your_site_name/modules/   Here we have file structure, "modules/custom/example". Step 2: Creating .info.yml    In Drupal8 .info files changes to .info.yml   Here we have, example.info.yml Step 3: Creating .routing.yml    Before registering the hook_menu we have to write the path in  .routing.yml file.   In Drupal 8 we won’t need hook_menu() anymore as we make heavy use of the  Symfony2 components  to handle the routing. This involves defining the     routes as configuration and handling the callback in a controller (the method of a Controller class).   Here the example.routing.yml Step 4: Creati...

How to add a 'related nodes' block that links to a taxonomy using views in Drupal 7?

1. Create an argument by adding the taxonomy field on which you want to find the related nodes. 2. Select "Provide default argument". 3. Argument type = "Taxonomy Term ID from URL" 4. Remove tick from "Load default argument from term page" 5. Tick the "Load default argument from node page, thats good for related taxonomy blocks." To remove duplicates you have to follow the following points. 1. Open "Query settings" in the "Advanced Settings". 2. Tick "Distinct". This gives you a perfect "Related Articles" or "Related Nodes" using Views.

Ajax image uploader in Drupal 7

Add the following code to 'YOUR_THEME.js' file and clear the cache * 'file' module should be enabled. ( function ( $ ) { Drupal . behaviors . autoUpload = { attach : function ( context , settings ) { $ ( 'form' , context ). delegate ( 'input.form-file' , 'change' , function () { $ ( this ). next ( 'input[type="submit"]' ). mousedown (); }); } }; })( jQuery );