Submitted by madmatter23 on Thu, 10/06/2011 - 11:12
The Faceted Search module produces a result set that looks almost exactly like Drupal's core search results. However, it does not use the search-results.tpl.php file. Rather, it uses it's own theming function: theme_faceted_search_ui_search_item().
You can, of course, set your own theme function to override this.
Here's a quick example of how I modified the way that users are displayed in the results:
Submitted by madmatter23 on Tue, 09/13/2011 - 07:06
Drupal's default 'Generic File' format can be a bit ugly. Luckily, it's not too hard to override. If you'd like to change the default filefield theming for 'Generic File', try using the theme_filefield_item() function in your template.php file.
Note: You may also be interested in checking out my post on customizing the filefield format in views.
In the example below, I overrode the default theming for all cck fieldfields belonging to node type 'publication'.
Submitted by madmatter23 on Thu, 08/18/2011 - 09:17
This one is a little bit more esoteric. I found the need change the page style (via CSS) based on whether the current user had permission to update the current node. Drupal preprocess_page to the rescue!
Just add this snippet to the yourTheme_preprocess_page function in your template.php file. It will add body classes (e.g., user-node-update, user-node-delete) to your page depending on the current user's permission to access the node being viewed.
Submitted by madmatter23 on Thu, 08/18/2011 - 08:49
If you'd like to change your site's appearance based on the current user's role, you can easily add the current user's role to the $body_classes array.
Just add this snippet to the yourTheme_preprocess_page function in your template.php file.
Drupal 6:
Submitted by madmatter23 on Mon, 08/15/2011 - 14:45
Drupal has a standard array of template suggestions that let you specify which TPL file should be used according to node type, node id, etc. However, there is no default template suggestion for pages generated by Panels.
You can easily fix that by adding a little snippet to your template.php files' preprocess_page() function.
Submitted by madmatter23 on Thu, 06/09/2011 - 09:00
By default, the Date module will will append the "(All Day)" tag to any CCK Date field for which the time (hours/minutes) input has been left empty. This is pretty annoying. There are many ways to work around this, but the simplest by far is to simple override the date_all_day_label() function in your theme's template.php file.
function grasmash_date_all_day_label() {
return '';
}
You will need to replace "grasmash" with the name of your theme.
Recent comments