Skip to content

Instantly share code, notes, and snippets.

@heddn
Created October 31, 2012 00:05
Show Gist options
  • Save heddn/3983958 to your computer and use it in GitHub Desktop.
Save heddn/3983958 to your computer and use it in GitHub Desktop.
/**
* Implements hook_url_outbound_alter().
*/
function MODULE_url_outbound_alter(&$path, &$options, $original_path) {
preg_match('@^search/(.+)@', $path, $matches);
// Only tack on a color nid facet if there isn't one already selected.
if (FALSE === strpos($matches[1],'/')) {
// The alias path will be the letter 'c'
$path .= '/c/' . color_selector($_COOKIE['color']);
}
}
/**
* Activate the pretty paths by default on all searchvers.
*
* @param array $searcher_info
* Searcher info.
*/
function mercy_solr_facetapi_searcher_info_alter(array &$searcher_info) {
foreach ($searcher_info as &$info) {
// Activate pretty paths on all searchers.
$info['url processor'] = 'pretty_paths';
$info['facetapi pretty paths coder'] = 'default';
}
}
Add a line to the global settings section of your MODULE_facetapi_defaults.inc
'pretty_paths_alias' => 'c',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment