Drupal Planet

Today we will look at creating a module to allow you to export your views to code. While this concept has been explored on other blogs previously, several important end steps that I find particularly useful have been left out of those discussions. I would like to remedy that here, detailing an entire process for setting up the module, displaying use scenarios, and also showing the changes that this module will make to your views administration process.

Disclaimer: This post describes how to create custom pages on your drupal site, and create custom menu items (page routes), within a module. After reading this post, you will know how to implement hook_theme() and hook_menu() to create custom urls (Paths) and very basic content templates in both Drupal 6 and Drupal 7. This tutorial assumes you know how to create and upload files to your server using FTP, and also know how to create a basic custom module to use as a foundation.

I'm going to go through a basic tutorial here today on importing iCal addresses into your Drupal 7 site as nodes. While there are already several modules that allow you to show your google (or other) calendar data on your site, importing your calendar with those modules usually has a few restrictions, such as limiting the specific data you can show, and not having very good methods for customizing your style. Using Feeds to import the data as nodes allows you to bring an events calendar to your site that is 100% customizable by you, the same way any other nodes on your site are customized.

The taxation rules that come with Drupal Commerce out of the box calculate VAT or sales tax for each line item without any conditions, so every item in the order is taxed. This works for many situations but if you have items which need to be tax exempt you're in trouble. But there is a relatively painless way around it using some rules and fields.

To start with create a new field on your product entity called Tax Exempt. Set it to be a Boolean, single on/off checkbox.

Disclaimer: This post describes how to create a custom module and use it to create custom permissions on your drupal site. The purpose is to present a general idea of how to implement hook_permission() (or hook_perm() if using drupal 6) to create custom permissions, as well as to use and find drupal hooks. This tutorial assumes you know how to create and upload files to your server using FTP.

When working on a new Drupal 7 site I noticed it was missing a feature from the old D6 CCK days that allows you to remove a single item from a field that has unlimited values. Unfortunately, this is not built into Drupal 7's fields, and though there are a couple of threads on drupal discussing this issue, it is considered a feature request for D8 by the core developers.

If you've ever built a large website that requires private files, then you've probably run into this before. In Drupal 6 the CSS optimization requires that the files be stored publicly. This is a known bug that will not be fixed according to the drupal developers.

The boss just shot you an email. He wants the user’s profile to get updated whenever that user creates a story node. He also wants to automatically post badges to a user’s profile when their story has been viewed a certain number of times. And you can’t use the statistics module, because it killed his family. Can you have it by this afternoon?

No problem. Hook_nodeapi’s got this.

One of the most frustrating things to deal with as a Drupal programmer can be Ubercart. Often, you need to complete a simple task such as sending an additional email, or giving a user a new role, and your options are to use Rules, Conditional Actions or just program it yourself.

Rules or Conditional Actions allow you to execute PHP, but sometimes you don't want to store your php code in an unformatted text field in the database. Enter hook_order(). One of Ubercart's primary hooks for getting stuff done.

Aegir is wizardry, pure and simple. Once you’ve got it set up and running there’s almost no excuse not to have all of your sites on it.

There are plenty of great tutorials on moving your existing site into Aegir like Dboettger’s tutorial or Aegir’s Community tutorial but they assume that you’re pretty handy with the command line.

If you don’t feel comfortable with the command line or you don’t want to mess with it you can still pull the migration off.