User login

Drupal Theming

Theme admin_menu icon

You don't really need to, because it's set to use the favicon if you've provided one in your theme settings.

But to override this, as described in the admin_menu README, simply copy this function (hidden in admin_menu.inc at the time of this writing) to your template.php file:

Printing classes for a theme depending on sidebar

<?php
function _phptemplate_variables($hook, $vars = array()) {
  switch ($hook) {
    case 'page':
      // our own hook to remove sidebars from admin pages, not relevant here
      if (arg(0) == 'admin') {
        $vars['sidebar_right'] = '';
      }
     
      // layout for body classes
      $vars['layout'] = '';

Theme Drupal search results

theme_search_item($item, $type)

http://api.drupal.org/api/function/theme_search_item/5

http://drupal.org/node/175013 => Customize the search results page

A separate issue raised in IRC:

Theming the File Attachments in Drupal 5.x

Alrighty then,

If you're reading this then you've probably been searching for a way to theme the default file attachment table in drupal and add cool icons according to the file's mime type, (ie. if it is an mp3 then a music icon will show, if a pdf then a pdf icon, etc)

This is a quick and easy method to help you get this done on your sites and make people think you are cool...

File: 
File: 
File: 
File: 
File: 
File: 

Overriding Nice Menus CSS the Agaric Way

Technically, this is overriding Nice menus the Nice menus way...

I pulled all nice menu css out of style.css and put it in nice_menus_custom.css and set this theme path so it overrides modules/nice_menus_default.css by entering the new path at the top of admin/themes/settings

Functional Accessibility Evaluator (FAE) web accessibility tool and resource; may be better than W3C

From one of our favorite clients, regarding a capability on which we need to greatly improve:

hi again... i dont remember if i sent this to you before, but i just had a whole meeting for the past hour about web accessibility and making video files/podcasts etc. accessible to people with disabilities.... this site, it doesnt pick up video stuff, but its super helpful in letting you know how compliant any website is with accessibility standards ....

http://fae.cita.uiuc.edu/

Overriding Fivestar star images with just CSS (and, well, graphics)

Copy this (from fivestar's CSS) into your theme's styles.css file, and change the background url to match your own graphic file:

div.fivestar-widget-static .star {
  float: left;
  width: 17px;
  height: 15px;
  overflow: hidden;
  text-indent: -999em;
  background: url(widgets/default/star.gif) no-repeat 0 0px;
}

Variables available in _phptemplate_variables for node templates

The variables you get to play with while setting new variables are nice.

So you can do switch or if statements on $var['type'] to only provide certain variables to certain node types.

<?php
function _phptemplate_variables($hook, $vars = array()) {
  switch ($hook) {
    case 'node':
        drupal_set_message('<pre>'.print_r($vars,TRUE).'</pre>');
        break;
  }
  return $vars;
}
?>

IE6 Transparent PNG Fix the Drupal Way

This is the IM conversation on implementing a jQuery ie6 PNG fix. Dan's elegant solution will go below... i don't quite follow where he put everything...

dan:
http://jquery.andreaseberhard.de/pngFix/

just dump it in the theme folder?

benjamin melançon:
yeah

and http://api.drupal.org/api/function/drupal_add_js/5

Syndicate content