Is it possible to make a top of page link? This would be the # URL
I tried, but it did not work.

Would there be available the nid token it would be possible i think.
Just node/1234/#

Or maybe if it would be possible to use html to make a link like a href="#"
or in other words if one would not specify a path but an URL

Comments

dankh’s picture

This is only possible via code. Toolbar uses the Drupal menu system for storing links (we don't reinvent the wheel :) ). Thus Toolbar requires a valid drupal path ( more info here http://api.drupal.org/api/function/menu_valid_path ) to create the shortcut. An anchor is not a valid Drupal path.

But :), you can make this via code. Toolbar is offering alter function (toolbar_build_shortcuts) so you can alter the shortcuts before render.

Here is an example of what you want called from custom module called "mymodule" :

function mymodule_toolbar_build_shortcuts_alter(&$links) {
   $top = array(
     'href'        => drupal_get_normal_path($_GET['q']),
     'title'       => 'Top',
     'fragment'    => 'top',
   );
   array_push($links, $top);
}

This function will all shortcut to the Toolbar with title "Top" and link to "#top".

baff’s picture

Great - Thanks a lot

avpaderno’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, as Drupal 6 is now not supported.