Skip to content

Instantly share code, notes, and snippets.

View chrisfromredfin's full-sized avatar

Chris Wells chrisfromredfin

View GitHub Profile
@chrisfromredfin
chrisfromredfin / example.drupalpod.yaml
Last active May 17, 2023 16:47
An example of a drupalpod.yaml file that could be included with a Contrib module.
# Each of these is a "profile" which can be enabled. Each profile is a set of
# settings for your install that DrupalPod can configure for you. You MUST have
# at least a "default" key in this file, or it will be discarded entirely (default
# is the profile used if an alternative is not specified in the URL, in DP_EXTRA_SETTINGS).
default:
# extra_packages: specifies additional composer packages to install. Use composer
# constraint syntax
extra_packages:
- drupal/automatic_updates:^3
Content
Third-party Integration
Utility
Content Display
Administration
Developer
Fields
E-commerce
Media
Commerce/Advertising
<?php
define('START', 0);
define('END', 948);
$output_handle = fopen('./projects.csv', 'w');
fputcsv($output_handle, [
'category',
'development status',
'maintained',
'body',
@chrisfromredfin
chrisfromredfin / NotNodeType.php
Created November 18, 2020 19:47
A "not node type" condition plugin
<?php
namespace Drupal\YOURMODULE\Plugin\Condition;
use Drupal\node\Plugin\Condition\NodeType;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\node\NodeInterface;
/**
* Provides a 'Not Node Type' condition.
{% macro buttonset(items) %}
<ul class="buttonset">
{% for item in items %}
<li><a class="button" title="{{ item.name }}">{{ item.label }}</a></li>
{% endfor %}
</ul>
{% endmacro %}
/// @name buttonset
/// @example njk
/// {% import 'buttonset.macro.njk' as mymacro %}
/// {{ mymacro.buttonset([{"name": "do something", "label": "open"}, {"name": "do something else", "label": "close"}]) }}
{% block content %}
<ul class="buttonset">
{% for item in items %}
<li><a class="button" title="{{ item.name }}">{{ item.label }}</a></li>
{% endfor %}
</ul>
{% endblock %}
/// @group components
/// @name buttonset
/// @example njk
/// {% set items = [{"name": "do something", "label": "open"}, {"name": "do something else", "label": "close"}] %}
/// {% include 'buttonlist.njk' %}
///
.buttonset {
li {
display: inline-block;
list-style-type: none;
/// Ratios we are using.
/// @group sizing
/// @ratios my-ratios
$my-ratios: (
'line-height': 1.4,
'gutter': 0.5,
);
@include herman-add('ratios', 'my-ratios', $my-ratios);
/// All the sizes that we have.
/// @group sizing
/// @sizes font-sizes {text}
$font-sizes: (
'base': 16px,
'important': 1.8rem,
'largest': 3rem,
);
@include herman-add('sizes', 'font-sizes', $font-sizes);