Showing posts from 2015

Bulk Content Import Drupal 7 (Feeds Module)

Required modules: FeedsSet up CSV: Prepare the Excel file that you will convert to CSV - open up Excel and in the first row add the headers. Feeds importer requires a global ID to uniquely identify nodes. So the first column should contain this unique identifier. Name this column "guid". The other column headers can be anything you like. For example, if you want to import a list of files with title; you can name your columns filename, title, description etc. The column headers do not have to match content type fields. Add data to the Excel file: guid: make sure each row has a unique number.filename: You will have to upload all the files you want to migrate, into your Drupal root directory. So put all your files in a directory called import-uploads and upload them to your Drupal root. Make sure that the filenames have the path from your Drupal root. So each filename should have "import-uploads/" prepended. E.g. "import-uploads/file1.pdf&quo…

How to add extra fields to user profile in Drupal?

Step 1. - Create custom module -For Example My custom module name is extra_user_profile
Folder Name - extra_user_profile
Files - extra_user_profile.nfo, extra_user_profile.module, extra_user_profile.install
Step 2. extra_user_profile.nfo file:- name = Extra User Profile description = Add new field in user profile core = 7.x version = "7.x-2.5" core = "7.x"
Step 3. extra_user_profile.module file:- <?php
Step 4. extra_user_profile.install file:- <?php
/**  * Implementation of hook_enable().  */ function extra_user_profile_enable() {   // Check if our field is not already created.   if (!field_info_field('field_nickname')) {     $field = array(         'field_name' => 'field_nickname',          'type' => 'text',      );     field_create_field($field);
    // Create the instance on the bundle.     $instance = array(         'field_name' => 'field_nickname',          'entity_type' => 'user&#…