Monthly Archives: May 2011

Show Menu Description Field in Node Add/Edit Form

Many components in Drupal have an optional title or description field. This text usually displays when a user hovers over an item. We had an interesting request: a client wanted to have a box that displayed text which would change every time you roll

Tagged with: , , , ,
Posted in Development

Views Taxonomy: Get Terms with Associated Nodes

This example serves as both an example of how to alter a Views2 query, as well as how to use the get_terms_by_count() function I’ve written. Unfortunately there is not (at present) a Views2 taxonomy filter that lets you “Get only terms with

Tagged with: , , , , ,
Posted in Development

Rebuilding the Drupal Navigation Menu (Automatically)

The following steps will get you a completely rebuilt Navigation menu. Clear your cache Backup your database In the database, remove any records in {menu_links} where menu_name = navigation Create a file somewhere in your site’s directory structure Add this

Tagged with: , , ,
Posted in Development

$user Conditionals

This is one example of performing an action based on whether or not the current user belongs to a certain role or roles. Note that the admin user (UID #1) matches as well.

Note: You may want to try using

Tagged with: , ,
Posted in Development

Passing Arguments to Drupal Blocks

You can pass any number of arguments to a Drupal block by providing default arguments. The screenshot below shows what an argument might look like in Views2.

Tagged with: , , ,
Posted in Development

Open All External Links in a New Window/Tab using jQuery

… and to match two urls/domains/whatever:

 

Tagged with: ,
Posted in Development