Drupal Alias Functions

1001

Drupal alias Functions : Drupal give Many function to get url alias on the Basis of system URL (source). Given a Drupal system URL return one of its aliases if such a one exists.

Some Usefull Alias Function given Below:

function drupal_get_path_alias

Given an internal Drupal path, return the alias set by the administrator.
If no path is provided, the function will return the alias of the current
page.


drupal_get_path_alias($path = NULL, $path_language = NULL);

Example: Use this Function Pass Source and get Alias Like:

 drupal_get_path_alias('node/12');

function drupal_lookup_path

Given a Drupal system URL return one of its aliases if such a one exists.
Otherwise, return FALSE.


drupal_lookup_path($action, $path = '', $path_language = NULL);

Example:


$get_alias = drupal_lookup_path('alias', 'node/1232');

function domain_path_lookup_path :

Given an domain specific alias, return its Drupal system URL if one exists. Given a Drupal
system URL return one of its domain specific aliases if such a one exists. Otherwise,
return FALSE.


function domain_path_lookup_path($action, $path = '', $domain_id = NULL, $path_language = NULL)

Example:


$domain_id = 3;

$str = 'product?term_node_tid_depth= 1232';
 $get_alias = domain_path_lookup_path('alias', $str, $domain_id, NULL);

LEAVE A REPLY

Please enter your comment!
Please enter your name here