Skip to content

Instantly share code, notes, and snippets.

View fieke's full-sized avatar

Sofie Verreyken fieke

View GitHub Profile
@vdchristelle
vdchristelle / bulk_update_author.info
Last active December 26, 2015 12:49
Bulk update change author to siteowner
name = "Bulk update author"
description = "Bulk update the author of your nodes to siteowner."
package = "the AIM"
core = 7.x
@vdchristelle
vdchristelle / template.php
Created September 23, 2013 14:51
Function adds the main-menu items to taxonomy menu block
<?php
function the_aim_theme_preprocess_taxonomy_menu_block(&$variables){
//only for block with delta == 1
if ( 1 == $variables['config']['delta']) {
$links = menu_tree('main-menu');
$main_links = array();
foreach ($links as $link) {
@vdchristelle
vdchristelle / background-check.min.js
Created September 23, 2013 14:08
If an element overlaps any of the images, either .background--dark or .background--light is added to it. BackgroundCheck does not change an element's style — you must do so using CSS. Bron: http://www.kennethcachia.com/background-check/
/* BackgroundCheck
http://kennethcachia.com/background-check
v1.0.0 */
!function(a,b){"function"==typeof define&&define.amd?define(b):a.BackgroundCheck=b(a)}(this,function(){"use strict";function a(a){if(void 0===a||void 0===a.targets)throw"Missing attributes";w.targets=d(a.targets),w.images=d(a.images||"img"),w.changeParent=a.changeParent||!1,w.threshold=a.threshold||50,w.minOverlap=a.minOverlap||50,w.classes=a.classes||{dark:"background--dark",light:"background--light"},w.windowEvents=a.windowEvents||!0,w.maxDuration=a.maxDuration||500,w.mask=a.mask||{r:0,g:255,b:0},w.debug=a.debug||!1,void 0===q&&(e(),q&&(r.style.position="fixed",r.style.top="0px",r.style.left="0px",r.style.width="100%",r.style.height="100%",window.addEventListener(v,n.bind(null,function(){g(),m()})),window.addEventListener("scroll",n.bind(null,m)),g(),m()))}function b(){q=null,r=null,s=null,w={},t&&clearTimeout(t)}function c(a){p("debug")&&console.log(a)}function d(a){var b=a;if("string"==typeof a?b=document.querySelectorAll(a):1==
@vdchristelle
vdchristelle / template.php
Created September 23, 2013 12:10
Override the value of the h1_title with the commercial title on taxonomy pages (for old sites)
<?php
//change node title to commercial title on taxonomy pages
if (isset($variables['page']['content']['system_main']['term_heading']['term']['#term']->tid)) {
$term_info = taxonomy_term_load($variables['page']['content']['system_main']['term_heading']['term']['#term']->tid);
if (isset($term_info) && !empty($term_info)){
$variables['h1_title'] = $term_info->the_aim_seo_pagetitle['und'][0]['value'];
}
}
//optie 2