Skip to content

Instantly share code, notes, and snippets.

View rakeshjames's full-sized avatar
💤

Rakesh James rakeshjames

💤
View GitHub Profile
@rakeshjames
rakeshjames / example.module
Created October 1, 2014 11:46
Drupal 7 Ajax call back on form submit example
<?php
/**
* @File
* The following code from the "example.module" will help you to find the example using AJAX form with one textfield called “Name”. When the submit button is pressed, it shows the output “Hello <Name>”.
*/
/**
* Implementing hook_menu().
*/
function example_menu() {
@rakeshjames
rakeshjames / ExampleController.php
Created September 30, 2014 12:04
Drupal 8 Custom module example
<?php
/**
* @file
* @author Rakesh James
* Contains \Drupal\example\Controller\ExampleController.
* Please place this file under your example(module_root_folder)/src/Controller/
*/
namespace Drupal\example\Controller;
/**
* Provides route responses for the Example module.
id: User_with_multiple_roles
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: null
label: 'User migration from CSV test'
source:
plugin: csv
path: /Users/rakeshjames/Sites/migrationdemo/csv/demouser_migrate_multipleRoles.csv
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# If you come from bash you might have to change your $PATH.
export PATH=/usr/local/Cellar/postgresql@9.6/9.6.10/bin:$PATH
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="$PATH:$HOME/.composer/vendor/bin"
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
id: migrate_csv_vocabulary
label: 'Migrate vocabulary from the csv file'
migration_group: migration_csv_custom
source:
plugin: csv
path: 'modules/custom/migrate_csv/assets/csv/vocabulary.csv'
header_row_count: 1
keys:
- Title
process:
ID Title Description
1 Food Add food related to terms to this vocabulary.
2 USA Add USA related to terms to this vocabulary.
3 Life Style Add Life Style related to terms to this vocabulary.
4 WAR Add WAR related to terms to this vocabulary.
5 Politics Add Politics related to terms to this vocabulary.
6 Sports Add Sports related to terms to this vocabulary.
ID name email firstname lastname Status roles Password
1 rakesh rakesh.james@gmail.com Rakesh James 1 administrator,migrationuser rakesh@123
2 james james.rakesh@gmail.com James Rakesh 1 authenticated james@123
3 dummy dummy@gmail.com Dummy User 1 migrationuser,administrator dummy@123
id: migrate_csv_articles
label: 'Migrate articles from the csv file'
source:
plugin: csv
# Full path to the file.
path: 'modules/custom/migrate_csv/assets/csv/articles.csv'
delimiter: ','
enclosure: '"'
header_row_count: 1
keys: