Blog Archives

Friendly URL for Views Contextual Filter on a Boolean Field

I have a story content type that has a corresponding Views listing page. The stories can be flagged as Featured through a checkbox/boolean field ( field_story_featured ). The stories also have a Story Type value ( field_story_type ). The views listing page needs to have the

Tagged with: , ,
Posted in Development

Quickly Implement a Block as a Paragraph in Drupal 7

Disclaimer: As with most tasks in Drupal, there are several ways to do this. My goal here was to see how quickly it could be done without writing code and without introducing unnecessary complexity. Goal — quickly implement a newsletter

Tagged with: , , , , ,
Posted in Development

Drupal Quick Tip: Easier “Archive” Filtering

I was working on a project today where we needed to show an archive of announcement nodes. The sidebar had to show a listing of months like this: This is easy to accomplish by using the default Archive view that

Tagged with: , , ,
Posted in Development

Views Exposed Filter: Terms for current language only

I’ve been working on a multilingual site that has a product finder. We have 3 exposed filters that allow a user to select an Activity, IP Category, or Industry. All of these filters are Taxonomy Term filters. Some of the

Tagged with: , , , , ,
Posted in Development

Proximity by City or Zip Code in Drupal 6 with Location and Views

The location module for Drupal 6 is a robust module. On most projects, it gives us 100 percent of what we need. Proximity searching based on zip code is built-in and fairly painless to setup. I’ve recently been tasked to also allow

Tagged with: , , , , , , ,
Posted in Development

Get a List of Top-level Taxonomy Terms

Quick Tip: Getting a list of taxonomy terms is easy using a view (type: Taxonomy). Trying to get only terms at the highest level is a bit trickier. One method I came up with is to add a Taxonomy: Parent term argument

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

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

Taxonomy Menus for Custom Views

Note: If you’re looking to just output a list of taxonomy terms that link to a custom view, please see PHP Code to Output a List of Terms Linked to a Custom View. If you need actual Drupal menu items for

Tagged with: , , , , ,
Posted in Development