What I Learned at Zivtech Drupal Training- Day 2

I've been at Zivtech's 2-day Drupal module development. The first day, I picked up a few great tips, such as modules and techniques. Here's what I got out of the second day:

General

Journal Module

You can use it to track changes for Drupal configuration

How to Make Patches

Didn't know how patches were made in Unix. They are really just output from diff. Duh.

Exporting/Importing Views

If your site really relies on views, you might want to export the views to use version control. Then you can turn off views UI on the production site. That way, it would be very hard for someone to f* up your views.

Exposed Filters in Views

If you "expose" a filter, you expose the filter to the UI. This is an easy way to improve the UI.

Modules

Chaos Tools

http://drupal.org/project/ctools. Provides a collection of tools and improvements to the Drupal API, including easy implementation of multi-step forms and wizzards.

Devel Reinstall

Often times you want to uninstall and install modules when developing, especially if your database schema has changed. Devel has a link called Reinstall Modules, where you can select what module you want to uninstall and install.

Semantic Views Module Plugin

This Views plugin makes unformatted styles, field row styles and other output more readily configurable without needing to override template files.

Views Bonus Pack Module

Adds assorted "style" options in Views UI, allowing you to attach a CSV, DOC, XLS version of the view to the page rendering the view.

Functions

check_markup()

Sanitizes HTML. Full HTML filters do not sanitize markup.

check_plain()

Sanitizes plain text.

hook_drupal_alter()

Effectively allows you to create custom hooks, so that other modules can hook into your module.

// in the module you want to create the hook 'mailfish_emails'
// $values, is some data you want to expose to other modules
drupal_alter('mailfish_emails', $values );

In another module:

function my_other_module_mailfish_emails( &$values) {
  //alter $values
}

hook_views_data(), hook_views_api()

These hooks allow you to expose your module's data to the Views and Views UI Module:

l()

Kind of knew about this, but didn't think about why I would use it. It creates a link, but besides for passing the link through the theme() function, it allows Drupal to keep track of what the alias is given the system path.

© 2010 Your Name.. Drupal theme by Kiwi Themes.