Skip to content

Instantly share code, notes, and snippets.

<?php
function mytheme_alpha_preprocess_node(&$vars) {
$node = $vars['node'];
if (isset($vars['field_topic'][0]['tid'])) {
$parents = taxonomy_get_parents($vars['field_topic'][0]['tid']);
$top_parent = array_shift($parents);
$vars['topic'] = field_view_value('node', $node, 'field_topic', array(
'tid' => $top_parent->tid, 'label' => 'hidden'));
@siefca
siefca / robot.js
Created December 4, 2012 12:43 — forked from fabiopimentel/robot.js
[CAELUM TEAM]Megatron
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();