Skip to content

Instantly share code, notes, and snippets.

View fieke's full-sized avatar

Sofie Verreyken fieke

View GitHub Profile
@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
@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 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 / 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 November 21, 2013 10:29
Wrapper around the term description field (because display suite does not allow) Base theme strips the prefix & suffix, you can reset it in your custom theme
/**
* Implements template_preprocess_taxonomy_term().
*/
function YOURTHEME_preprocess_taxonomy_term(&$variables) {
// Add taxonomy term description wrapper
$variables['content']['description']['#prefix'] = '';
$variables['content']['description']['#suffix'] = '';
}
@vdchristelle
vdchristelle / responsive-table.scss
Created November 21, 2013 11:27
Responsive table
/* Responsive table */
@media all and (max-width: 640px) {
.table,
.row,
.column,
.column:before {
display: inline-block;
/* Converts a table, table row, table column and table column:before into a block element */
}
@vdchristelle
vdchristelle / team_members.scss
Created November 22, 2013 08:30
Team members
//--------------
//---- TEAM ----
//--------------
ul.team {
@include span-columns($total-columns);
padding: 0 !important;
li {
list-style: none;
@include span-columns($total-columns);
border-bottom: 1px solid $grey;
@vdchristelle
vdchristelle / google_map_custom_icon.html
Last active June 7, 2016 09:58
Google map with custom icon + custom balloon Google Maps Custom markers info: https://developers.google.com/maps/tutorials/customizing/custom-markers Google MAPS API: https://developers.google.com/maps/documentation/javascript/reference#InfoWindow -------> ATTENTION: do not put this code in de document load part <---------------
// add this to your html page (e.g. in a block)
<div id="map_canvas">map_canvas</div>
@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);
@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 {