Skip to content

Instantly share code, notes, and snippets.

@vdchristelle
vdchristelle / only_variables_passed_by_reference_1679118_4.patch
Created January 27, 2015 15:09
Video embed field module 7.x-2.0-beta5 - Strict warning: 'Only variables should be passed by reference in template_preprocess' Bron: https://drupal.org/node/1679118
diff --git a/video_embed_field.module b/video_embed_field.module
index 54491d4..8a45ebb 100755
--- a/video_embed_field.module
+++ b/video_embed_field.module
@@ -354,7 +354,8 @@ function template_preprocess_video_embed_field_embed_code(&$variables) {
// Prepare embed code
if ($handler && isset($handler['function']) && function_exists($handler['function'])) {
- $variables['embed_code'] = drupal_render(call_user_func($handler['function'], $variables['url'], $variables['style_settings']));
+ $embed_code = call_user_func($handler['function'], $variables['url'], $variables['style_settings']);
@vdchristelle
vdchristelle / new_gist_file_0
Created January 27, 2015 15:09
Adding node type and node id to the link field in WYSIWYG.
//----------------------------------------
//------------- CKEDITOR -----------------
//----------------------------------------
/*
* alter cklink to add language
*/
function YOUR_MODULE_ckeditor_link_autocomplete_alter(&$results, &$string){
if ($string !== '') {
$types = ckeditor_link_get_types();
$results = array();
@vdchristelle
vdchristelle / the_aim_author_change.php
Created January 27, 2015 15:09
Node operation to change the content author to siteowner
<?php
/**
* Implementation of hook_help().
*/
function the_aim_author_change_help($path, $arg) {
switch ($path) {
case 'admin/help#the_aim_author_change':
$output = '<h3>' . t('Add extra bulk operation for content') . '</h3>';
$output .= '<p>Unpublished node created by admin are not accessable for siteowners.<br />Therefore we must change the author of the nodes to siteowner. This module adds the extra bulk update action...</p>';
@vdchristelle
vdchristelle / custom_block_back_to_overview.php
Created January 27, 2015 15:08
Provides a custom 'Back to overview' button - Block
<?php
/**
* Implementation of hook_block_info().
*/
function the_aim_custom_block_info() {
$blocks = array();
$blocks['back-to-overview'] = array(
'info' => t('Back to overview'),
@vdchristelle
vdchristelle / only_variables_passed_by_reference_1679118_4.patch
Created February 6, 2014 09:56
Video embed field module 7.x-2.0-beta5 - Strict warning: 'Only variables should be passed by reference in template_preprocess' Bron: https://drupal.org/node/1679118
diff --git a/video_embed_field.module b/video_embed_field.module
index 54491d4..8a45ebb 100755
--- a/video_embed_field.module
+++ b/video_embed_field.module
@@ -354,7 +354,8 @@ function template_preprocess_video_embed_field_embed_code(&$variables) {
// Prepare embed code
if ($handler && isset($handler['function']) && function_exists($handler['function'])) {
- $variables['embed_code'] = drupal_render(call_user_func($handler['function'], $variables['url'], $variables['style_settings']));
+ $embed_code = call_user_func($handler['function'], $variables['url'], $variables['style_settings']);
@vdchristelle
vdchristelle / offcanvas.scss
Created December 9, 2013 11:41
off canvas top region
// OFF-CANVAS TOP REGION
#top {
background: $grey-light;
color: $white;
overflow: hidden;
> .container {
position: relative;
overflow: hidden;
height: 5em;
-webkit-transition: height 0.5s ease-out;
@vdchristelle
vdchristelle / _variables.scss
Created December 5, 2013 10:58
Testtool breakpoint: op iPad heb je idd break-1 en break-3… => komt vanuit the_aim_theme, base font iets kleiner gezet en nu gaat hij op iPad van break-2 naar break-3
//-- FONT SETTINGS --
//-------------------
$base-font-size: 13.5px;
@vdchristelle
vdchristelle / colorbox-extra.js
Created December 5, 2013 10:42
colorbox gallery Overview page with teasers: we want every teaser to be a gallery of its own and not all images off all teasers in 1 colorbox solution: add specific class per gallery on the a elements
// references
// loop through teasers
// add different rel to each li
// for colorbox to see each teaser as a separate gallery
var count = 0;
$('ul.references.overview li').each(function(){
$(this).find('.colorbox a').attr('rel','gallery-'+count);
// add class to first list item, to be able to hide all others
$(this).find('ul li:first').addClass('show');
count++;
@vdchristelle
vdchristelle / insert.scss
Created December 5, 2013 07:30
WYSIWYG inserted styles
img.inserted {
width: 50%;
float: left;
}
.left .inserted {
float: left;
margin: rhythm(0.3) rhythm(0.5) rhythm(0.25) 0;
}
.right .inserted {
@vdchristelle
vdchristelle / width.scss
Created December 3, 2013 15:48
calculate width by colums and gutter
width: columns(4,9) + (columns(1,9)/2) + (gutter(9)/2);
margin-right: gutter(9);