You are here

function masonry_search_preprocess_search_results in Masonry Search 7.3

Same name and namespace in other branches
  1. 7 masonry_search.module \masonry_search_preprocess_search_results()

Implements hook_preprocess_HOOK() for theme_search_results().

File

./masonry_search.module, line 47
Displays search results in a Masonry layout.

Code

function masonry_search_preprocess_search_results(&$variables) {

  // Get options
  $options = variable_get('masonry_search', masonry_default_options());
  if (!isset($options['masonry'])) {
    $options['masonry'] = 0;
  }

  // Display search results in a Masonry layout
  if ($options['masonry']) {
    $container = '.search-results';
    $options['masonry_item_selector'] = '.search-result';
    masonry_apply($container, $options);
  }
}