function themekey_path_nid2alias in ThemeKey 7.2
Same name and namespace in other branches
- 7.3 modules/themekey.path.inc \themekey_path_nid2alias()
ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).
src: node:nid dst: path:node_alias
Parameters
$nid: a node id
Return value
string or NULL if no value could be mapped
1 string reference to 'themekey_path_nid2alias'
- themekey_path_themekey_properties in modules/
themekey.path.inc - Implements hook_themekey_properties().
File
- modules/
themekey.path.inc, line 56 - Provides some ThemeKey properties related to the path module.
Code
function themekey_path_nid2alias($nid) {
$node_path = 'node/' . $nid;
$alias = drupal_get_path_alias($node_path);
if ($alias != $node_path) {
return $alias;
}
return NULL;
}