Created
October 31, 2012 00:05
-
-
Save heddn/3983958 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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