Skip to content

Instantly share code, notes, and snippets.

View rakeshjames's full-sized avatar
💤

Rakesh James rakeshjames

💤
View GitHub Profile
name: Example_events
type: module
description: Example module for Event handling in Drupal 8.
core: 8.x
package: Examples
Node Js Tutorial study links.
https://blog.risingstack.com/node-hero-tutorial-getting-started-with-node-js/
http://www.tutorialspoint.com/nodejs/
<?php
/**
* @file
* Install, update and uninstall hooks for the Example Profile install profile.
*/
/**
* Implements hook_install().
*
<?php
/**
* @file
* Enables modules and site configuration for the Example Profile profile.
*/
// Add any custom code here like hook implementations.
name: Example Profile
type: profile
description: Example for profile creation in Drupal8.
core: 8.x
distribution:
name: Example Distribution.
dependencies:
- automated_cron
server {
listen 80 default_server;
root /srv/www/drupal8;
index index.php index.html index.htm;
server_name YOUR_SERVER_NAME.com;
location / {
try_files $uri @rewrite;
}
<?php
/**
* Implementing hook_form_alter()
* @param $form
* @param $form_state
* @param $form_id
*/
function YOUR_MODULE_NAME_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'views_exposed_form') {
$term_reference_tree_path = drupal_get_path('module', 'term_reference_tree');
@rakeshjames
rakeshjames / example.module
Last active August 29, 2015 14:10
Drupal 7 How to add a button act like "Clear all caches" in the custom form in custom module? example
<?php
/**
* @File
* Example for button act like "Clear all caches" in the custom form in custom module
* @author Rakesh James
*
*/
/**
* Implementing hook_menu().
# 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";
}
@rakeshjames
rakeshjames / auto_load_block.php
Created October 14, 2014 09:37
Auto click or auto loading popup with colorbox drupal 7?
<?php
global $base_url;
print "<div class = 'auto-click'><a href='" . $base_url . "/video/1?width=500&height=500' class = 'colorbox-load'></a></div>";
if (!empty($_GET['banner'])) {
$thankyou = $_GET['banner'];
if ($thankyou == 'yes') {
echo "<script langauge='javascript'>
jQuery(window).load(function(){
jQuery('.auto-click a').click();
});