Blog

Modifying browser history and url using jQuery

You open a popup and actually want the browser url to reflect the popup/overlay url. You do this for multiple reasons, but mainly for SEO and social media links. It also allows the visitor to use the 'back' button and have your page react using AJAX instead of actually reloading the previous page.Here's...
Read more

Add your own custom user permissions in Drupal 7

Say you created a module that has a page that only certain user roles should be able to access. If you're not using Panels/Page Manager (which can limit per user role) and you're using your own hook_menu item, you'll need to come up with your own permission that will show up on /admin/people/permissions. ...
Read more

Using db_select with conditional statements in Drupal 7

While the debate never ends about using db_select versus db_query...some say db_select is slower and db_query should be used for simple queries, but there are obvious advantages to db_select with its extenders and much more.Whatever your decision, here is one case where db_select is super nice. Instead of building the query string in a variable...
Read more

Using the Services module in Drupal 7 to create a REST API

Adding an API to your Drupal site doesn't have to be difficult, well...not too difficult. Using the Services module removes a lot of the work needed and sets you up for an easy implementation. Its especially nice with its hooks and it outputs everything in json format and handles error messaging.I won't get...
Read more