Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / prebuilt-option-list.module.php
Created November 19, 2013 15:33
Webform prebuilt (prefilled) option list with nested taxonomy tree (1 language) Webform prebuilt (prefilled) option list with node titles
/**
* Implementation of hook_webform_select_options_info().
* See webform/webform_hooks.php for further information on this hook in the Webform API.
*/
function the_aim_custom_webform_select_options_info() {
$items = array();
$items['terms'] = array(
'title' => t('Taxonomy terms'),
'options callback' => '_options_terms'
);
@vdchristelle
vdchristelle / _node.scss
Created November 7, 2013 12:58
Events standalone module - creates CT - creates dummy content - creates latest & overview block NOTE!!!! You need to make a folder 'inc' and put the inc files in there
//---------------------
//---- EVENTS ---------
//---------------------
// Latest events
.events.latest {
background: $grey-light;
padding: rhythm(0.5);
img {
margin: 0 rhythm(0.25) rhythm(0.25) 0;
@vdchristelle
vdchristelle / block-subpages.tpl.php
Created October 30, 2013 21:18
Custom functionality for Soloya: - promoted to frontpage block with icons - taxonomy menu block with icons - 3rd level menu block with icons - testimonial overview and footer teaser block - sidebar icon block wich displays field_icon of the node
<?php
$max = count(element_children($nodes));
// Set up striping values.
$count = 0;
?>
<div class="overview icon-view subpages">
<ul>
<?php foreach ($nodes as $node) {
$count++;
$attributes = array();
@vdchristelle
vdchristelle / striping.js
Created October 28, 2013 15:48
Add striping (odd even classes) in jQuery - stripe
/*
* Add striping
*
*/
function stripe(el){
var count = 0;
$(el).each(function(){
count++;
var classEven = '';
var classOdd = '';
@vdchristelle
vdchristelle / get-object.php
Created October 28, 2013 08:36
check if we have a node page or a taxonomy page in a custom block content function
<?php
//get object
$obj = menu_get_object('node',1);
if (isset($obj)){
// it's a node page
} else {
// it's a taxonomy page
$obj = menu_get_object('taxonomy_term',2);
}
@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