Skip to content

Instantly share code, notes, and snippets.

View sadanandkenganal's full-sized avatar

Sadanand Kenganal sadanandkenganal

View GitHub Profile
@sadanandkenganal
sadanandkenganal / drupal_multisite..md
Last active August 29, 2015 14:02
Configuring a basic multisite development environment in Linux

Basic multisite environment in Linux

Step 1: Download and uncompress Drupal

You can download and uncompress Drupal by following the steps on the Download and uncompress Drupal page of the Installation guide, as this step does not differ from a normal installation.

Step 2: Set up your hosts file

Add the following lines to /etc/hosts:

@sadanandkenganal
sadanandkenganal / update_drupal_core.md
Last active August 29, 2015 14:01
Update Drupal Core

Steps to update Drupal core with a newer version of Drupal. (Eg. Drupal 7.27 to Drupal 7.28)

1. Make a backup of your Drupal instance. (Imp. With site folder and mysql)
2. Download the latest release of Drupal version.
3. Extract the [tar ball or zip] Drupal package.
4. Set your site on maintenance mode. (Visit this admin/config/development/maintenance).
5. Delete all the files & folders inside your original Drupal instance except for /sites folder and any custom files you added elsewhere.
  1. Copy all the folders and files except /sites from inside the extracted Drupal package [tar ball or zip package] into your original Drupal instance.
@sadanandkenganal
sadanandkenganal / redirect_in_drupal7.md
Last active August 29, 2015 14:01
Redirect users after login in drupal7.

How to redirect users after login in drupal?

For example, there is page called user-serach. I want to redirect to a user-search page, when the user of some ROLE 'user-search-role'.

For this, you need to implement, hook_user_login(&$edit, $account).

Complete Code

@sadanandkenganal
sadanandkenganal / clea_url_drupal7.md
Last active September 7, 2017 07:23
Enable Clean URL's drupal 7

It's very simple.

In your project Directory, you have .htaccess file. open it and make the following changes. Its a hidden file.

  1. Modify the RewriteBase if you are using Drupal in a subdirectory or in a VirtualDocumentRoot and the rewrite rules are not working properly. For example if your site is at http://example.com/drupal uncomment and modify the following line:

Line 106 - RewriteBase /yourprojectname(project folder)

  1. If your site is running in a VirtualDocumentRoot at http://example.com/, uncomment the following line and modify:

One Day Workshop On Drupal

##Agenda ###Goals

  • Students attending the workshop should come away with a good understanding of what Drupal does and what types of sites it can be used for.
  • They should be exposed to the basics of building a site in Drupal.
  • They should be exposed to the modules most people use to build Drupal sites.