Skip to content

Instantly share code, notes, and snippets.

@wluisi
wluisi / action-kit-markup.html
Created December 1, 2016 05:36
CRP 24 Hours Action Kit Markup
<div class="pdf-downloads row">
<div class="large-6 medium-6 small-12 columns">
<ul class="clean-ul-list">
<li>
<a href="#">
<span class="link-text">United States</span>
</a>
</li>
<li>
<a href="#">
@wluisi
wluisi / d7-flexloader-flexslider-tpl-ex.php
Created November 4, 2016 18:03
Drupal Flexslider/Flexloader TPL Example
<?php
<section class="content-component content-component--slider">
<div class="row">
<div class="col-md-12">
<h2>
<?php print $slider['title']; ?>
</h2>
<div class="flexslider">
<ul class="clean-ul-list slides">
@wluisi
wluisi / drupal-flexload-flexslider-example.js
Created November 4, 2016 18:01
Flexslider/Flexloader Drupal Example
(function($) {
Drupal.behaviors.cc_slider__flexslider = {
attach: function (context, settings) {
$(window).load(function() {
$('.flexslider').flexslider({
animation: "slide",
controlNav: true,
slideshow: false,
// Wire up flexloader
@wluisi
wluisi / dd-atom-xdebug.md
Last active September 25, 2016 22:39
Setup Xdebug with Acquia DD and Atom

Setup Xdebug with Acquia Dev Desktop/MAMP and Atom

Xdebug settings

Can be added to php.ini, but should go in xdebug config, what happens when dev desktop gets updated?

xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
@wluisi
wluisi / prog-create-drupal-commerce-order.php
Created September 2, 2016 20:20
Programmatically Create Drupal Commerce Order
<?php
/**
* Creates an order for the given user containing the product with the given id.
* This example may be extended easily to create an order containing several
* products, a shipping and so far.
*
* Returns a commerce order that's now saved in the database with the status
* "processing and can be finished by an administrator in the UI.
* Throws an exception, if something is wrong.
@wluisi
wluisi / rw-form-validator.php
Created June 28, 2016 01:42
rw inline error search form
<?php
// admin/config/user-interface/ife
// Set search form to 'enabled' and "remove all messages".
// LZ filter validation
$lz_filter_raw = $form_state['values']['lz_filter'];
preg_match_all('!\d+!', $lz_filter_raw, $zipcode);
$zipcode = $zipcode[0][0];
// Check if zip code is in RW database
@wluisi
wluisi / uca_gcse_form.php
Last active June 4, 2016 05:59
uca_gcse_form.php
<?php
/**
* Form builder for the searchbox forms.
*/
function google_cse_searchbox_form_builder(&$form_state, $form_id, $self = FALSE) {
$form = array();
// The default form.
if (variable_get('google_cse_results_display', 'here') == 'here') {
$form['#action'] = url($self ? $_GET['q'] : 'search/google');
@wluisi
wluisi / NodeBlogFeaturedImage.php
Created May 25, 2016 18:39
client_migration_blog_featured_image
<?php
<?php
/**
* @file
* Contains \Drupal\client_migration\Plugin\migrate\source\NodeBlogFeaturedImage.
*/
namespace Drupal\client_migration\Plugin\migrate\source;
@wluisi
wluisi / d8blogmigration.yml
Created May 25, 2016 18:27
D8 Migration YML
# blog node migration YML file.
langcode: en
status: true
migration_group: D6 to D8
dependencies:
config:
- migrate_plus.migration.client_migration_blog
module:
- client_migration
@wluisi
wluisi / NodeBlogFeaturedImage.php
Last active May 25, 2016 17:33
Node Blog Featured Image D8 Migration Plugin
<?php
/**
* @file
* Contains \Drupal\my_module\Plugin\migrate\source\NodeBlogFeaturedImage.
*/
namespace Drupal\my_module\Plugin\migrate\source;
use Drupal\file\Plugin\migrate\source\d6\File;