User login

how to

Disallow browsing of a web directory's files

All by itself in a .htaccess file in the directory of interest (and it covers subdirectories) this will do it, for an Apache webserver:


Options -Indexes

Use checkboxes for multiple select form elements

Checkboxes are more user-friendly than multiple-select option form field.

Taxonomy Super Select seems to be the popular choice.

Better Select worked better for our needs, however:
http://drupal.org/project/betterselect

Fortunately, it has a node form only option. It also has an always save parent also option! All under Administer » Site Configuration » Better Select.

Note that Content Taxonomy would also be an option for this functionality.

Awesome CSS for centering a list item menu of unknown width: very useful for Drupal

We do Drupal. This CSS will of course work for any HTML that outputs a surrounding container (probably div) and an unordered list with floats, but you can find lots of tutorials on that around the web. From Agaric you get the straight Drupal and nothing but the Drupal (ok, not really).

If you put a menu in your footer, you're not going to see the code it directly in your page template. Instead, the footer section of your zen subtheme page.tpl.php might look like this:

Customize breadcrumbs (for node_gallery module, using custom_breadcrumbs module)

Here is how i customized the breadcrumbs for galleries to remove the username, building on the documentation at http://drupal.org/node/544748#breadcrumbs and contributing back to that page what you see below:

Prevent breaks on white space

While there is the venerable   (no-break space), there is a better way with CSS:

white-space: nowrap

See also
http://www.nixer.org/css-prevent-line-breaks

How to theme a form in Drupal 6

Theming a form, like theming almost anything in Drupal 6, requires registering the theme function with hook_theme in a module or a theme. The FormAPI docs and the Drupal 5.x to Drupal 6.x form upgrade guide (Drupal 5.x to 6.x FormAPI changes appear to remain a little deficient in explaining this.

See for instance How to theme a form in Drupal 6.x?

Add CSS to a Drupal page through template.php

http://api.drupal.org/api/function/drupal_add_css/6

Adding styles through the API: How to use the drupal_add_css function to add a CSS file
http://drupal.org/node/225868

Similar for JavaScript:

Compare two strings in a bash script

bash script compare text

if [ $var == "value" ]
then
echo is the same
fi

http://www.tech-recipes.com/rx/209/bournebash-shell-scripts-string-comparison/

(Numbers are -eq)

Set your name in

git config --global user.name "My Name"
git config --global user.email "me@example.com"

http://www.lixo.org/archives/2008/06/26/git-tip-set-your-identification-and-colours/

http://help.github.com/git-email-settings/

JavaScript Bookmarklet to open a web site's path in a new window with a different base URL

This is useful when manually checking each page on a site to the corresponding page on a replacement site, as the final check before taking the new site live.

Starting with the basic Drupal.org documentation-style JavaScript, and hacked at it:

Syndicate content