function hook_domainpath in Domain Access 7.2
Same name and namespace in other branches
- 6.2 API.php \hook_domainpath()
Allows modules to alter path when rewriting URLs.
This hook will fire for all paths and may be resource-intensive. Look at Domain Prefix for best practices implementation. In Domain Prefix, we only include this function if we know it is necessary.
Parameters
$domain_id: The domain_id taken from {domain}.
$path: The internal drupal path to the node.
$options: The path options.
$original_path: The raw path request from the URL.
See also
domain_prefix_init()
Related topics
1 invocation of hook_domainpath()
- _domain_path_modules in ./
domain.module - Helper function for domain_path() checks.
File
- ./
domain.api.php, line 630 - API documentation file.
Code
function hook_domainpath($domain_id, &$path, &$options, $original_path) {
// Give a normal path alias
$path = drupal_get_path_alias($path);
// In D7, path alias lookups are done after url_alter, so if the
// alias is set, the option must be flagged.
$options['alias'] = TRUE;
}