Drupal Theming
Image link rollovers for dynamic (user-uploaded) graphics with Drupal and CSS
Eliminating other options:
This could be done with JavaScript, but we and the W3C and everyone's sanity would much prefer a pure CSS solution.
Can you have inline styles with pseudo classes (namely, :hover?)
No: http://www.frontpagewebmaster.com/m-351101/tm.htm
From http://www.christianmontoya.com/2006/02/01/pure-css-image-rollover/
Add a span wrapper inside primary and secondary menu links in Drupal 6
This document takes us through the steps of figuring out how some output is produced (without an Integrated Development Environment with debugger) so that we can modify it. Skip straight to Agaric's answer in the resolution at the bottom if that's all you want!
All I want to do is throw spans around the links. Ah well. Here is the function below, modified to do exactly that.
It will do it to all sets of links passed through theme('links', $links) but so far on Agaric's example site, at least, that means only the primary links.
<?php
function examplezen_links($links, $attributes = array('class' => 'links')) {
Building a Zen sub-theme: In shell commands
From the Zen documentation How to build your own sub-theme (6.x), translated into bash commands. The project is called example, and we have installed the zen theme to sites/default/themes.
Someone enterprising could make this into a simple bash script.
cd /sites/example/www/sites/default/themes
sudo cp -pr zen/STARTERKIT/ example_zen
Internet Explorer 6 appears to have PNG problems beyond its well-known transparency issues
IE6 has extremely weird PNG issues
Microsoft owes me another 4 hours of my life.
Just to let you know, apparently PNGs (without transparency, nothing to do with transparency on the page anywhere I was aware of, though there was a video and lots of other stuff), can simply fail to show up in the image tag. A completely normal img src style tag just doesn't display.
Panels2 and Organic Groups
So you want to use drupal's Organic Groups module and Panels2 because you've heard through the grapevine that really slick and useful things can be done with the combo..
Well, here's what one of the experts has to say about it --> http://www.tejasa.com/node/160
highly recommended and very useful...
do it!
Where in the theme are the tabs printed / giving tabs to admins only
On giving View, Edit, Revision, etc. tabs to administrators only.
In Drupal, tabs are not printed by the node, but by the page. On the one hand, since views and administrative pages and anything else you can think of can have tabs, this makes sense. But on the other hand every node can have
Drupal theming tip: theme_ functions you should NOT override
Theme functions are designed so that they can be overridden, but the building block theme functions provided by Drupal core should be left alone.
In discussion with a colleague, who provided all the insight paraphrased below, talking about some of the Drupal gotcha's we've seen get talented people not sufficiently indoctrinated into the Drupal way.
Sidebar graphics with links ("promotional badges") the Agaric Drupal way
A note of warning about the length of notes to follow: This is site configuration at the point where it verges on developer documentation, such is the power of Drupal, and there's some outright theming in here too. This article is a reaction to doing sidebar graphics the painfully non-Drupal way.
Theming CCK Views the Agaric Way (with background)
Note that Views and CCK's imagefield module have excellent imagecache integration and you only need these steps if you want very fine-grained control-- in our case, automatically populating the ALT text of the image with the node title.
/admin/build/views/wizard
and
http://agaricdesign.com/note/how-theme-lots-views-agaric-way
and then a little
<?php
print '
';
If you think like we do you'll have something like this in template.php:
<?php
/**
* Theme views invoked by view-specific callbacks (see below).
*/
function phptemplate_views_template($template, &$view, &$nodes, &$type) {
$fields = _views_get_fields();
$taken = array();
// Set up the fields in nicely named chunks.
foreach ($view->field as $id => $field) {
Different page templates for different content types
Once upon a time there was a drupal themer working on a dark and stormy night, he sat there wondering how to make different page templates for certain content types on his site. He thought about how the drupal template system seems to be missing this for some reason... Suddenly, he had a vision! Like a ray of light bringing, hope and happiness down from the heavens!! oh yes!!
<?php
// Add additional template suggestions
function _phptemplate_variables($hook, $vars) {
switch ($hook) {
case 'page':
// Add page template suggestions based on node type, if we aren't editing the node.
if ($vars['node'] && arg(2) != 'edit') {
$vars['template_files'][] = 'page-'. $vars['node']->type;
}
break;
}
return $vars;
}
?>