Skip to content

Instantly share code, notes, and snippets.

View chriscalip's full-sized avatar

Christopher Calip chriscalip

  • Chicago, IL
  • 06:27 (UTC -05:00)
View GitHub Profile
langcode: en
status: true
dependencies: { }
id: ya_node_article
migration_tags: null
migration_group: ya_example
label: 'Nodes (Article)'
source:
plugin: d7_node
node_type: article
field_drupal8_pages:
plugin: migration
migration: ya_node_page
source: field_drupal6_pages
field_drupal8_xxx:
plugin: migration
migration:
- ya_node_xy
- ya_node_xx
leaflet:
js:
/libraries/vendor/leaflet/leaflet.js: {}
css:
component:
/libraries/vendor/leaflet/leaflet.css: {}
<input type="search" id="autocomplete-dataset" class="form-control" placeholder="Search for vacation rentals or cities" />
<script src="https://cdn.jsdelivr.net/algoliasearch/3/algoliasearchLite.min.js"></script>
<script src="https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.js"></script>
<style>
.algolia-autocomplete {
width: 100%;
}
.ad-example-dropdown-menu {
width: 100%;
<?php
public function simple() {
$is_authenticated = \Drupal::currentUser()->isAuthenticated();
$content = 'Hello World';
$build = [
'#theme' => 'page_example_map_it',
'#is_authenticated' => $is_authenticated,
'#action_form' => $content,
'#cache' => [
function deparam(params, coerce) {
var obj = {}, coerce_types = { 'true': !0, 'false': !1, 'null': null };
// Iterate over all name=value pairs.
$.each(params.replace( /\+/g, ' ').split('&'), function(j, v) {
var param = v.split('='),
key = decodeURIComponent(param[0]),
val,
cur = obj,
i = 0,
<?php
namespace Drupal\address\Plugin\search_api\processor;
use Drupal\Component\Utility\Html;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Form\FormStateInterface;
use Drupal\search_api\Processor\FieldsProcessorPluginBase;
/**
@chriscalip
chriscalip / README.md
Created May 4, 2017 01:10
Sample Drupal 8 Feature documentation for situations where codebase is all over the place.

Capacitype Collection Feature List.

Feature: [Collection content should be visible only to author by default][1]

Description

Collection nodes are visible only to the author node and users with permission "bypass node access"

Feature Manifest

@chriscalip
chriscalip / settings.devforpantheon.php
Created August 2, 2017 16:30
Inspired by settings.pantheon.php; the idea is to use settings file to diverge configurations between environments.
<?php
/**
* @file
* Capacitype Overrides for Pantheon environment configuration file.
*
* This enforces logic that for all pantheon environments the following gets enforced :
* a.) Except for live envinroment, sending mail as logs in devel temp directory.
* b.) Search API algolia : assets2algolia & topics2algolia are only enabled on LIVE pantheon envinroments.
* c.) Enforce find-it active search index for live environment only.
@chriscalip
chriscalip / settings.php
Created August 2, 2017 16:56
Updated settings.php to include settings.local.php and settings.devforpantheon.php
<?php
/**
* Load services definition file.
*/
$settings['container_yamls'][] = __DIR__ . '/services.yml';
/**
* Include the Pantheon-specific settings file.
*