User login

Drupal 6

Remove the main content title from the front page of the site

Sometimes we have a lot of blocks from views and such on our front page, going where the content usually goes, so we don't want our front page to be the /node stream. We could make it a View page but if all the other Views are blocks, it seems wrong to play favorites (and may be annoying for theming or changing things later). Plus, it's nice to have that one node for the little bit of (easily editable) static content.

Here's the function for "example" theme's template.php to remove the page title:

Features cannot update the names of roles

Features stores Drupal roles as their string name, not their ID. This is so that they are in theory exportable (like Views, variables, and - when enhanced by features_extra - blocks and vocabularies). Naming something by a machine name rather than an autoincremented numeric database ID allows

However, the only information carried with a role is its name! Therefore, trying to take a role name change from one site to another results in the following:

Using Imagecache for a theme's user-provided logo

Agaric considers it best practice (meaning we do it occasionally) to keep a logo (the user-uploaded logo), so that the site principal can have its logo swapped out by an administrator, and not only by a developer or themer. Practically, some designs will have the logo so integrated that it should not be swappable, but note that one additional advantage of having a clean and separate logo file is that people can swipe it and display their brand loyalty while linking to you. Or maybe add devil horns to it in MS Paint.

Display the word count of a piece of content

In the most useful comment on a thread of useful comments, Greg Harvey describes how to get the word count for a node in the template level: access just the body portion of the content variable for a node in and count the words in template.php, then output this variable in node.tpl.php.

Configuring blocks for your admin theme

Drupal 6 introduces the feature of choosing an administration theme, and it can be any theme that is physically present in your Drupal installation; it does not have to be enabled. You simply select the theme at admin/settings/admin

However, to modify which blocks are in which region, to have the theme show up on the configure blocks page at admin/build/blocks, you must enable the theme at admin/build/themes (once you are done you can disable it again).

Syndicate content