Skip to content

Instantly share code, notes, and snippets.

View fieke's full-sized avatar

Sofie Verreyken fieke

View GitHub Profile
@fieke
fieke / custom.module
Created October 28, 2013 14:34
Clone webform block
function the_aim_picstory_block_info() {
$blocks = array();
// Webform footer block
$blocks['webform-footer-block'] = array(
'info' => t('CB - Webform footer block'),
);
return $blocks;
}
@fieke
fieke / template.php
Created October 29, 2013 07:47
Change post date to time ago + date link to node
function theme_preprocess_node(&$variables, $hook) {
// create default theme suggestion for node so
// node--{node_type}--{view_mode}.tpl.php is available
$variables['theme_hook_suggestions'][] = "node__" . $variables['type'] . "__" . $variables['view_mode'];
switch ($variables['type']) {
case 'news':
// ADD LINK TO NEWS DATA - HOMEPAGE
if($variables['view_mode'] == 'blog_teaser' && isset($variables['content']['title']['#items']['0']['value'])) {
@fieke
fieke / custom.txt
Created October 29, 2013 12:53
Top image
// TOP IMAGE
function _topimage() {
global $language;
// if we are on a node page
if(arg(0) == 'node') {
// get the current node
$obj = menu_get_object();
@fieke
fieke / template.php
Created November 4, 2013 09:46
Override the value of the h1_title with the commercial title on taxonomy pages (for old sites)
function the_aim_theme_preprocess_page(&$variables, $hook) {
if(arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
$variables['h1_title'] = drupal_get_title();
$term_info = taxonomy_term_load($variables['page']['content']['system_main']['cont']['field_overview_image_large']['#object']->tid);
if (isset($term_info) && !empty($term_info)){
$variables['h1_title'] = $term_info->the_aim_seo_pagetitle['und'][0]['safe_value'];
drupal_set_title($variables['h1_title']);
}
}
}
@fieke
fieke / Berekening breakpoint 2.scss
Last active December 27, 2015 11:39
Berekening breakpoint 2.scss
// susy
width: columns(4,9) + (columns(1,9)/2) + (gutter(9)/2);
margin-right: gutter(9);
// neat
width: flex-grid(4.5, 9) + flex-gutter(9);
@fieke
fieke / responsive-tables.js
Created November 12, 2013 15:13
responsive tables
(function($) {
$('thead').each(function() {
$th = $(this).find('th')
$(this).next('tbody').find('tr').each(function(tr) {
for(var i = 0; i < $th.length; i++) {
$(this).find('th, td').eq(i).attr('data-label', $th.eq(i).text());
}
});
});
})(jQuery);
@fieke
fieke / _forms.scss
Created November 22, 2013 09:28
Submit button on Iphone
input[type="submit"] {
-webkit-appearance: none;
-moz-appearance: none;
}
@fieke
fieke / .scss
Created November 22, 2013 11:01
Cross browser alpha transparent background CSS (rgba)
.div{
background:rgb(255,255,255);
background: transparent\9;
background:rgba(255,255,255,0.8);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#ccffffff,endColorstr=#ccffffff);
zoom: 1;
&:nth-child(n) {
filter: none;
}
}
@fieke
fieke / _block.scss
Created November 27, 2013 09:34
responsive circles
.circle-text {
width:50%;
}
.circle-text:after {
content: "";
display: block;
width: 100%;
height:0;
padding-bottom: 100%;
background: #4679BD;
@fieke
fieke / bulk_update_author.info
Last active August 29, 2015 14:08
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