Skip to content

Instantly share code, notes, and snippets.

instructions on how to get the body field in the content region to have multiple columns
@tsavory
tsavory / global.css
Created May 8, 2012 21:42
Help fix css for nifelseki
/* This file will hold styles for the mobile version of your website (mobile first). */
/* This also can include ANY global CSS that applies site-wide. Unless overwritten by a more specific style rule, CSS declarations in global.css will apply site-wide. */
div#page{
background: url('/sites/default/files/images/main_bg.jpg') no-repeat;
background-attachment: fixed;
background-position: center top;
background-color: #153c63;
}
@tsavory
tsavory / Navin Basse Css
Created June 5, 2012 06:46
added layer styles
css[navin-base.css][name] = 'Navin: Base'
css[navin-base.css][description] = 'This file contains the base page styling.'
css[navin-base.css][options][weight] = '10'
settings[alpha_css][navin-base.css] = 'navin-base.css'
css[navin-font.css][name] = 'Navin: Font'
css[navin-font.css][description] = 'This file contains the font stylings for the site.'
css[navin-font.css][options][weight] = '11'
settings[alpha_css][navin-font.css] = 'navin-font.css'
@tsavory
tsavory / sidebars
Created June 5, 2012 19:02
change sidebars columns depending on layout css
(function ($) {
Drupal.behaviors.yourfunction = {
attach: function(context) {
$('body', context).once('responsetoggle', function () {
$('body').bind('responsivelayout', function (e, d) {
if (d.to == 'narrow') {
@tsavory
tsavory / css3-colums.js
Created June 5, 2012 20:06
Copy of CSS3MultiColumn
// CSS3MultiColumn - a javascript implementation of the CSS3 multi-column module
// v1.02 beta - Jan 08 2008
// Copyright (c) 2005 Cdric Savarese <pro@4213miles.com>
// Copyright (c) 2012 Gabriel Saldana <gabriel@gabrielsaldana.org>
// This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
// For additional information, see : http://www.csscripting.com/
// Supported Properties:
// column-count
@tsavory
tsavory / no media quries
Created June 5, 2012 22:44
overcome ie7+ie8 lack of media query to perform layout switch. litwol piggybacked ride on omega multi-layout support. but he couldn't use media queries. so the aim was to provide different means to trigger layout change without relying on media query.
function hook_css_alter(&$css) {
if ('[your theme name]' == $GLOBALS['theme'] && ($theme = alpha_get_theme()) && $theme->settings['responsive']) {
$request_session = request_session_get(); // This is my internal api. tells me parameters about current widget request. namely what size it wants to be in this request... narrow or wide.
$old_grid = $theme->grid;
$layouts = $theme->grids['[your custom layout name]'];
$size_selector = [some selector criteria/request];
switch ($size_selector) {
case '1':
$layouts['layouts']['narrow']['enabled'] = FALSE;
break;
@tsavory
tsavory / base.make
Created June 6, 2012 17:56
basic make file from drushmake.me
; ----------------
; Generated makefile from http://drushmake.me
; Permanent URL: http://drushmake.me/file.php?token=91cec1b91cbf
; ----------------
;
; This is a working makefile - try it! Any line starting with a `;` is a comment.
; Core version
; ------------
; Each makefile should begin by declaring the core version of Drupal that all
@tsavory
tsavory / HammHetFiled_Menu
Created June 6, 2012 21:37
Adding admin menu and sub Tabs
When adding menus and tabs remeber you have to use the MENU_DEFAULT_LOCAL_TASK to get Tab to show up
So this
function djehouti_menu() {
$links = array();
// Dashboard
$links['admin/djehouti'] = array(
'title' => 'Djehouti',
'description' => 'Dashboard page',
'page callback' => 'djehouti_page_dashboard',
@tsavory
tsavory / respondsive_layout
Created June 8, 2012 03:53
bind jquary to responsive layout
Found the answer in http://drupal.org/node/1299286#comment-5412342 (thanks @bc and @himerus)
You can bind to the jQuery global event 'responsivelayout':
jQuery('body').bind('responsivelayout', function() { /* handle event */ } );
The global event is defined in omega-mediaqueries.js with $.event.trigger. Because it's global, you can bind a listener to any object in the DOM.
So my custom code should look like:
@tsavory
tsavory / adding to omega
Created June 8, 2012 04:48
helpfull omega links
http://drupal.org/node/1508452 Add ie conditional classes out of the box