Skip to content

Provides custom search functionality for those who don't wish to use Drupal Views.

License

Notifications You must be signed in to change notification settings

UofS-Pulse-Binfo/chado_custom_search

Repository files navigation

Tripal Dependency Module is Generic GitHub release (latest by date including pre-releases)

Build Status Maintainability Test Coverage

Chado Custom Search

Provides custom search functionality for those who don't wish to use Drupal Views.

Why might you want to use this module?

  • Gives you complete control of the query so you can tweak performance.
  • Removes query-determination overhead of Drupal Views for better performance.
  • Lets you make quick custom searches which can be under version control.
  • Saves you from having to render the result table, generate the filter form, handle the user input and execute the query.
  • Lets you focus on customizing only what you want to!

Chado Custom Search API

  1. Implement hook_chado_custom_search to tell the API about the search you would like to create.
/**
 * Implement hook_chado_custom_search().
 *
 * This hook simply lists the machine name of the searches so that we can find
 * the info hook. We've done this for performance reasons.
 */
function example_ccsearch_chado_custom_search() {
  $searches = [];

  $searches['BreedingCrossSearch'] = 'Breeding Cross Search';

  return $searches;
}
  1. Create a class which extends ChadoCustomSearch. At a minimum you need to set the editable static constants and the getQuery() method. See BreedingCrossSearch for an example.

  2. Clear the cache, navigate to the path defined in the class and enjoy your custom search!

Documentation

For more information on what you can accomplish or how to get started, see our ReadtheDocs Documentation.

About

Provides custom search functionality for those who don't wish to use Drupal Views.

Resources

License

Stars

Watchers

Forks

Packages

No packages published