Skip to content

Instantly share code, notes, and snippets.

@z3cka
z3cka / pmtc.js
Created November 9, 2012 23:28
a poormans tag cloud built from drupal views rows
(function($){
$(document).ready(function(){
// build an awesome tag cloud
function rowobject(param1, param2){
this.name=param1;
this.countresult=param2;
}
// create array that will be filled with objects
var rows = Array();
// grab a tag count for each tag
@z3cka
z3cka / gist:3988438
Created October 31, 2012 17:19
example of current views row markup
<div class="views-slideshow-cycle-main-frame-row-item views-row views-row-0 views-row-first views-row-odd">
<span class="views-field views-field-field-image">
<span class="field-content"><img typeof="foaf:Image" src="http://victoryfoam.sey.gr/sites/default/files/styles/medium/public/victory-foam-specialty-tool-case-4.jpg" width="192" height="220" alt="">
</span>
</span>
<div id="title-body-wrapper">
<span class="views-field views-field-title">
<h2 class="field-content"><a href="/node/8">Tool Control</a></h2>
</span>
<div class="views-field views-field-body">
@z3cka
z3cka / template.php
Created October 19, 2012 05:21
page preprocess var for login/logout
function ninsixty_spw_preprocess_page(&$vars) {
global $user;
if ($user->uid != 0) {
// code for the logout button
$vars['loginout'] = "<a href=\"/user/logout\">Log out</a>";
} else { $vars['loginout'] = NULL; }
}
@z3cka
z3cka / yourawesomemodule.module
Created October 15, 2012 23:24
remove so and so's blog link from the blog links
/**
* Implements hook_node_view_alter().
*/
function yourawesomemodule_node_view_alter(&$build){
// remove so and so's blog link from the blog links
if ($build['links']['blog']) {
$build['links']['blog'] = NULL;
}
}
@z3cka
z3cka / index.html
Created September 21, 2012 05:09
fbf2
index.html coming