Anchor (#) im Menüeintrag
Eine URI wie node/3#anker wird von Drupals Menüsystem umgewandelt in node/3%232anker. Dieser Link funktioniert nicht und führt zu einem 400-Fehler (Seite nicht gefunden).
Folgendes kleine PHP-Snippet - in der Datei template.php des verwendeten Themes untergebracht - erlaubt die Nutzung des # in URIs. Die URI muß im Menüeintrag allerdings komplett eingegeben werden: http://server/node/3#anker
function phptemplate_menu_item_link($item, $link_item) { // Convert anchors in path to proper fragment
$path = explode('#', $link_item['path'], 2);
$fragment = !empty($path[1]) ? $path[1] : NULL;
$path = $path[0];
return l(
$item['title'],
$path,
!empty($item['description']) ? array('title' => $item['description']) : array(),
!empty($item['query']) ? $item['query'] : NULL,
$fragment,
FALSE,
FALSE
); }