Skip to content

Instantly share code, notes, and snippets.

Design & Frontend

Description

Building successful, useable high-performing and beautiful websites requires you to go beyond the framework. Every time.

Having a framework to build on - no matter how flexible and powerful - is only the first step. This year's frontend track will focus on implementing established best practices in both design, workflow and code.

Together we will take your Drupal websites that important step further.

Main themes

Applying frontend and UX best practices in Drupal

<?php
/**
* Implements hook_form_alter().
To Replace the -Any- value in filters by it's label text
*/
function theme_form_alter(&$form, &$form_state, $form_id) {
kpr($form);
if ($form['#id'] == 'views-exposed-form-admin-people-block-1') {
// $my_label = 'label name';
@mareksotak
mareksotak / main_menu.php
Created July 14, 2011 22:14
Add span to first level items only
<?php
function mytheme_preprocess_menu_link__main_menu(&$vars) {
// first level
if ($vars['element']['#original_link']['plid'] == 0) {
$vars['first_level'] = 1;
if ($vars['element']['#original_link']['in_active_trail']) {
$vars['active'] = 1;
}
}
@mareksotak
mareksotak / context ui
Created November 19, 2010 15:30
Context UI Block
/**
* Implementation of hook_block().
*/
function mymodule_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$blocks = array();
if (module_exists('jquery_ui') && module_exists('context')) {
$blocks['editor'] = array('info' => t('One Context editor'), 'admin' => TRUE);
}