Skip to content

Instantly share code, notes, and snippets.

View sadanandkenganal's full-sized avatar

Sadanand Kenganal sadanandkenganal

View GitHub Profile
@sadanandkenganal
sadanandkenganal / drupal_menu_tabs.md
Last active August 29, 2015 14:02
How to hide menu tabs, menu links and assign access permissions in Drupal 7

Hide menu tabs, menu links and assign access permissions in Drupal 7

hide "create new account" tab in "/user" page. To hide menu tabs we have to use hook_menu_alter hook. This hook changes the menu items. So here we are going to alter menu tabs that come with user module. Using this hook we can also do some other changes like title, permissions etc.

###For hiding menu tabs

Eg: Hide 'create new account' tab  and 'request password' tab.

In your Custom module
@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

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.