Skip to content

Instantly share code, notes, and snippets.

View jenlampton's full-sized avatar

Jen Lampton jenlampton

View GitHub Profile
* - $comments: The comment-related elements for the node.
* - $comments['comments']: Rendered comments for this node.
* - $comments['comment_form']: Form for adding a new comment.
@jenlampton
jenlampton / drupal.inc.patch
Created September 4, 2015 02:49
possible fix for drush_drupal_version
diff --git a/includes/drupal.inc b/includes/drupal.inc
index b24dc52..f34fee2 100644
--- a/includes/drupal.inc
+++ b/includes/drupal.inc
@@ -47,15 +47,23 @@ function drush_drupal_version($drupal_root = NULL) {
}
}
else {
- // D7 stores VERSION in bootstrap.inc.
- // D6 and below does it in system.module.
@jenlampton
jenlampton / BackdropBoot.php
Last active October 9, 2015 17:48
A start on the BackdropBoot class for Drush 7.
<?php
/**
* @file
* Backdrop Boot class for Drush.
*/
namespace Drush\Boot;
class BackdropBoot extends DrupalBoot {
@jenlampton
jenlampton / gist:5647420
Last active December 17, 2015 17:39
New node template (and variables) for Twig in D8
<article id="node-{{ nid }}" class="clearfix {{ attributes.class }}"{{ attributes }}>
{{ title.prefix }}
{% if not page %}
<h2{{ title.attributes }}><a href="{{ url }}" rel="bookmark">{{ title.label }}</a></h2>
{% endif %}
{{ title.suffix }}
{% if display_submitted %}
<footer>
@jenlampton
jenlampton / gist:5650953
Last active December 17, 2015 18:09
New comment template (and variables) for Twig in D8
<article{{ attributes }}>
{{ title.prefix }}
{% if new %}
<mark class="new">{{ new }}</mark>
{% endif %}
<h3{{ title.attributes }}>{{ title.label }}</h3>
{{ title.suffix }}
<footer>

This is a proposal for the new Drupal 8 theme system. It consists of 5 Phases.

Example for terminology: For the following explanation and all examples, let's say we are working with a node of type Article.

  • hook = the name of the module or theme that is inplementing the hook (examples at bottom)
  • THEME_ID = name of the theme hook. for the node template his will be node.
  • SUGGESTION_ID = name of the template suggestion. for the node template, this will be article.

1) Definition

@jenlampton
jenlampton / backdrop-contrib-application.md
Last active March 10, 2016 19:52
Backdrop CMS Contributed Project Group Application

Keybase proof

I hereby claim:

  • I am jenlampton on github.
  • I am jenlampton (https://keybase.io/jenlampton) on keybase.
  • I have a public key whose fingerprint is 5B4F 7ADD F457 04F3 43F7 81A1 74FB 416C 2168 43B9

To claim this, I am signing this object:

<?php
/**
* @file
* Provides a token for building URL aliases for NGO articles.
*/
/**
* Implements hook_token_info().
*/
function example_token_token_info() {
Backdrop.jsAC.prototype.populatePopup = function () {
var $input = $(this.input);
// Show popup.
if (this.popup) {
$(this.popup).remove();
}
this.selected = false;
this.popup = $('<div id="autocomplete"></div>')[0];
this.popup.owner = this;