Sunday, May 20, 2012 04:09 pm EDT

Welcome to Bri-Space

Bri-Space is a site that I started as a sandbox for Drupal module testing. It sat for quite some time as i only occasionally used it to test out some contributed modules before moving them to a production site. I added all kinds of stuff along the way, most of which I took down. After awhile I decided to share what I have learned along the way while tackling Drupal projects. I am in no way, shape, or form an expert on Drupal, but perhaps others can find useful tidbits.

In addition to Drupal info, I occasionally post information about general PHP, CSS, or anything that i think might be beneficial to other web developers.

Bri's picture

Theme Files to Open in a new window based on Mime Types

There is a thread on drupal.org that describes how to theme drupal 6 filefields and Drupal 7 files to have them open in a new window based on the mime type. I am posting this here so that I can find it easier the next time I need to do so. I didn't write this code. I haven't tried the Drupal 6 code, but the thread appeared to have several people confirm that it worked. I myself can confirm that the code for drupal 7 works.

Add one of the following to your template.php file in your theme.

For Drupal 6 file fields

  
Bri's picture

Drupal 7 Views Contextual Filters to Create a Summary of Taxonomy Terms

Here I want to setup a page with a few views. I want to create a page of node teasers of some sort, perhaps with some exposed filters, but I also want a block that shows a summary of my nodes. I want the block to show how many nodes are in a particular taxonomy. This is nice to do with a taxonomy of States or "types" and acts as a "view nodes by type" action. This can be done with a regular text field as well, but if you are using a taxonomy it is a little trickier. Here are some basic instructions to create a page that looks like the following:

Bri's picture

Git command cheat sheet

The majority of this list came from http://cheat.errtheblog.com/s/git but I have added in some tidbits that I have found in other places as well.

Configuration

git config -e [--global]
edit the .git/config [or ~/.gitconfig] file in your $EDITOR

git config --global user.name 'John Doe'
git config --global user.email johndoe@example.com
sets your name and email for commit messages

git config branch.autosetupmerge true
tells git-branch and git-checkout to setup new branches so that git-pull(1)

Bri's picture

Change the submitted variable in drupal 7

Go to: /admin/config/regional/date-time/formats/add
Create desired time format, i.e. l, d/m/Y or see http://id.php.net/manual/en/function.date.php for available options.
Add format.
Go to: /admin/config/regional/date-time
Set medium data type into the desired one.

Syndicate content