Skip to content

Instantly share code, notes, and snippets.

@gildotdev
Created April 20, 2011 20:11
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save gildotdev/932595 to your computer and use it in GitHub Desktop.
Save gildotdev/932595 to your computer and use it in GitHub Desktop.
This Drupal 7 function will allow you to use anchor names/fragments in your menu links. This functions goes in your template.php file in your theme directory. Remember to change THEMENAME to your theme's name.
@gildotdev
Copy link
Author

This works in concert with 2 other pieces. First it looks for Menu titles that have "Jump to Top". You can of course change this to what you need. Second it uses the anchor name/fragment id called top. In your html.tpl.php file add this right below the body tag: <a name="top" id="top"></a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment