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 September 18, 2013 06:50
Make custom block in custom module
/**
* Implementation of hook_block_info().
*/
function custom_block_info() {
$blocks = array();
// Products overview
$blocks['product-overview'] = array(
'info' => t('Product overview'),
);
@fieke
fieke / custom.module
Created September 18, 2013 06:58
Add icon to default taxonomy menu block
/**
* Implements hook_taxonomy_menu_block_tree_alter
*/
function custom_taxonomy_menu_block_tree_alter(&$tree, $config) {
switch($config) {
// add icon image to cache of TMB
case '2':
foreach($tree as $tid => $term) {
@fieke
fieke / custom.module
Created September 18, 2013 07:00
Add language to CKlink
/*
* alter cklink to add language
*/
function custom_ckeditor_link_autocomplete_alter(&$results, &$string){
if ($string !== '') {
$types = ckeditor_link_get_types();
$results = array();
foreach ($types as $type) {
$func = $type['module'] .'_ckeditor_link_'. $type['type'] .'_autocomplete';
if($type['type']=="node"){
@fieke
fieke / custom.module
Created September 18, 2013 07:01
Add back to overview block
/**
* Implementation of hook_block_info().
*/
function custom_block_info() {
$blocks = array();
// back to overview
$blocks['back-to-overview'] = array(
'info' => t('Back to overview'),
);
return $blocks;
@fieke
fieke / template.php
Created September 18, 2013 07:08
Bug Google analytics -> Basetheme
function basetheme_preprocess_html(&$vars) {
$vars['theme_folder'] = base_path() . path_to_theme();
// Function to cleanup html source a bit more
function indent($string) {
$spacing = " ";
$string = ltrim(str_replace('<link', $spacing . '<link', $string));
$string = ltrim(str_replace('<meta', $spacing . '<meta', $string));
$string = ltrim(str_replace('<script', $spacing . '<script', $string));
@fieke
fieke / _site.scss
Created September 18, 2013 08:23
Full screen image background
img.fullsizebackground{
/* Set rules to fill background */
min-height: 100%;
min-width: 1024px;
@include opacity(.3);
/* Set up proportionate scaling */
width: 100%;
height: auto;
@fieke
fieke / _site.scss
Created September 18, 2013 08:25
Transparante hover effect
.div{
@include span-columns($total-columns omega, $total-columns);
position: relative;
top: -80px;
left: 0;
z-index: 0;
a{
cursor: pointer;
border-bottom: none;
@fieke
fieke / template.php
Created September 18, 2013 08:27
Add link to news data
/*
* Implements hook_preprocess_node
*/
function theme_preprocess_node(&$variables, $hook) {
switch ($variables['type']) {
case 'news':
// ADD LINK TO NEWS DATA - HOMEPAGE
if($variables['teaser'] == true && isset($variables['content']['title']['#items']['0']['value'])) {
@fieke
fieke / template.php
Created September 18, 2013 08:29
add file size to downloads
//FIELD PREPROCESSING MADE POSSIBLE FOR ANY FIELD
function theme_process_field(&$variables) {
$function = 'autorijschool_process_field__'. $variables['element']['#field_name'];
if(function_exists($function)) {
$variables = $function($variables);
}
}
//ADDS FILESIZE TO A DOCUMENTS FIELD
function theme_process_field__field_documents (&$variables) {
@fieke
fieke / new_gist_file
Created September 18, 2013 09:02
Flexslider chrome bug fix
/*Chrome bug fix (page moving up and down a few pics on slide) */
#content {
-webkit-transform: rotate(0deg); /* WebKit */
-moz-transform: rotate(0deg); /* Mozilla */
-o-transform: rotate(0deg); /* Opera */
-ms-transform: rotate(0deg); /* Internet Explorer */
transform: rotate(0deg); /* CSS3 */
}