Preparation

Page Sections

Skills Required

In order to use the Tripal API the developer should have the following skills: 

  • Knowledge of PHP.
  • Knowledge of Chado and relationships between tables (at least tables where data of interest is stored).
  • Familiarity with Tripal's Chado API functions.

For creating custom modules the following additional skills are required:

  • Familiarity with Drupal module development
  • Familiarity with the Full Tripal API

Best Practices

There are a few rules to follow when updating templates or creating new modules:

For custom module development:

  • Consider using Drupal's git repository for housing your module development.  Drupal allows users new module developers to create their modules within a "Sandbox".  You can read more about Drupal's sandbox here: https://www.drupal.org/node/1011196
  • In order to ensure your custom module follows all security protocols, consider reviewing your module with an online tool like http://pareview.sh/.

The Drupal Devel Module

Before staring your development work, it is suggested that you download and install the Drupal devel module. This module helps greatly with debugging your custom theme or module. A very useful function of this module is the dpm function. You can use the dpm function to print to the web page an interactive view of the contents of any variable. This can be extremely helpful when accessing Chado data in objects and arrays returned by Tripal.

For example, each template for a node has a node object. If you want to see all of the variables and record present in the node object simply add the following to the top of the template file:

dpm($variables['node']);

To see a list of all of the variables available to your template you would use the following:

dpm($variables);

This function can also be used for debugging variables during module development.