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 19, 2013 07:54
Rotating block logo's
/**
* Implent pre process node
*/
function custom_preprocess_node(&$variables) {
switch ($variables['type']) {
case 'block':
if (isset($variables['field_add_rotating_partners']) && $variables['field_add_rotating_partners']['und']['0']['value'] == 1) {
$partners = views_embed_view('logos', 'logos_homepage');
@fieke
fieke / custom.module
Created September 19, 2013 07:57
Hook form alter to filter reference CT in onother CT
/**
* Hook form_alter
*/
function custom_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
// alter the dropdown for the products, used by a success story
case 'success_stories_node_form':
$language_map = array(
@fieke
fieke / style.scss
Created September 23, 2013 13:06
Table layout: fixed zet de breedtes gelijk.
ul.menu {
display: table;
table-layout: fixed;
}
ul.menu li {
display: table-cell;
}
@fieke
fieke / script.js
Created September 26, 2013 08:20
slideToggle voor Fredo
// TOGGLE MENU
$('.toggle h3').click(function() {
$(this).siblings('ul').slideToggle('fast');
});
@fieke
fieke / custom.php
Created September 26, 2013 14:17
Implement hook_form_alter // Ontvang PDF via email
function theme_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'webform_client_form_9':
// send along url with contact form
$form['submitted']['location']['#value'] = request_path();
break;
case 'webform_client_form_47':
// create return link to product
if (isset($_GET['nid'])) {
@fieke
fieke / custom.module
Created September 27, 2013 12:21
Add back to overview link in taxonomy view
/**
* Implements hook_taxonomy_term_view().
*/
function theme_taxonomy_term_view($term, $view_mode, $langcode) {
switch ($term->vid) {
case '2':
// Create return to overview-link
$path = request_path();
$path = explode('/', $path);
// if we are on the deepest level (the third, unless someone has been fucking with the setup)
@fieke
fieke / html.tpl.php
Created October 18, 2013 08:37
Add Google maps markers
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=nl"></script>
<script type="text/javascript">
function LoadGmaps() {
var iconBase = '/sites/rijschoolmerelbeke/themes/autorijschool/custom-marker-icon.png';
var myLatlng = new google.maps.LatLng(50.9955690,3.7455221);
var myLatlng2 = new google.maps.LatLng(51.0568298,3.7092637);
var myOptions = {
zoom: 10,
center: myLatlng2,
disableDefaultUI: true,
@fieke
fieke / _block.scss
Created October 22, 2013 09:35
Choose random div
.testimonial > div {
display: none;
}
@fieke
fieke / custom.php
Created October 24, 2013 07:14
Add overview movies + masonry & filter
<?php
/**
* Implementation of hook_block_info().
*/
function the_aim_picstory_block_info() {
$blocks = array();
// OVERVIEW MOVIES
$blocks['movie-overview'] = array(
'info' => t('CB - Movie overview'),
@fieke
fieke / style.css
Created October 25, 2013 16:30
Fix bug in Chrome font
html {
-webkit-text-stroke: 0.25px;
}