Menu Minipanels in Adaptivetheme - Instant Mega Menu for Any Menu Item
Menu Minipanels is a very cool little module that allows you to attach a mini panel to a menu item, which then pops open when you hover the menu item - aka instant mega menu!
Menu Minipanels is a very cool little module that allows you to attach a mini panel to a menu item, which then pops open when you hover the menu item - aka instant mega menu!
A recent client wanted to remove everything from the user login page when the site was in maintenance (or Site off-line as its referred to in most system messages and documentation). Just showing the user login form when the site is off-line actually makes a lot of sense because whats the point of showing things like primary links, search block or whatever else might show on your normal user login page.
Sometimes its useful to have a page.tpl.php template per node type. While you can have a node-[type].tpl.php be default in Drupal 6, the same does not apply to page level templates.
To add these template suggestions to your theme simply add the following code to template.php, replacing themeName with the name of your theme.
Today I finally got around to testing out the new field suggestions in Drupal 7. If you're not familiar with the standard suggestions in short you can either use field templates or override theme_field using a naming convention not unlike we do with preprocess functions. What struck me as kind of odd was the lack suggestions for field types—maybe there's a very good reason for this such as performance, I don't know, but I thought it might be interesting to see if I could use them, if I wanted to.
We had a project recently where we needed to add first and last classes to Drupals secondary local tasks. I was in a bit of a hurry so instead of trying to figure this out myself I Googled it and pretty quickly found this post on Drupal.org which seemed to fit the bill. Problem is the post doesn't actually tell you how or where to use the snippet, which isn't much good for those of you struggling with Drupal in the first place.
Drupal's template suggestions are plentiful and pretty powerful stuff, however, given all the options there are some noteable oversights. In particular the ability to use page-taxonomy suggestions per vocabulary, something like page-vocab-1.tpl.php to theme all taxonomy term pages in vocabulary 1 (where 1 is the VID or vocabulary id).
To achieve this we turn to our trusty preprocess_page function which by now every Drupal themer worth his or her salt knows all about.
In this short tutorial I'm going to show you how to set a unique class on your nodes based on taxonomy terms, which is something I've been asked about more than once or twice.
First thing you need is a template.php file and inside that declare a preprocess function. We're going to use this function to build an array of class names and then print them in node.tpl.php. With me? Ok.
What a bane of the theme developers life, [IE's inability to load more than 30 linked stylesheets](http://support.microsoft.com/kb/262161). This is a huge pita and forces you to either turn off modules or manually aggregate your themes stylesheets, such as how the [Genesis theme](http://drupal.org/project/genesis) does with its option to use an "all-in-one.css" stylesheet as a workaround.
I've become a big fan of the fantastic Blocktheme module. Up until now I've followed the README instructions and either built blocktheme templates or just printed the $blocktheme variable in my block.tpl.php and block-xxx.tpl.php templates.
Thats all well and good, but in my current project I wanted to be able to theme blockthemes by region. The main reason for this is we are making just very minor changes to the block styles depending on the region and we see no point in creating additional blockthemes.
I'm going to show you how to use hook_theme to make some commonly requested changes to the Search form and the Comments form in Drupal 6. We're also going to learn how this is done in your Genesis subtheme and the normal way of doing things. Take it as read the that the Genesis method also works for Zen sub-themes since the implementation of hook_theme for subthemes is the same.