I'm trying to use the links__system
preprocess function to output a menu as a select element, unfortunately though $link['href']
appears to output the URL in a format like:
node/2
Even though the URL alias is set to something like:
nice-url
The code I'm using in my template.php
file is as follows:
function THEME_links__system_MENU_NAME($variables) {
$html = '<select name="" id="dropdown-menu">';
$html .= '<option class="" value="home">Select Item</option>';
foreach ($variables['links'] as $link) {
$html .= '<option class="" value="' .$link['href'].'">'. $link['title'] .'</option>';
}
$html .= '</select>';
return $html;
}
I've had a look at the $variables
variable passed to this function, just to make sure I'm not referencing the wrong thing - but it doesn't appear to contain any other items in the array that contain the correct URL alias.
When using the default menu code output by Drupal it picks up the URL aliases and uses them.
What am I doing wrong here?