This is just a quick information post. If you use Magento and want to “bookmark” parts of a page that is all well and good, but how do you generate a url to go to it? there is a good question. Here is the simple answer.

You just need to pass the “_fragment” parameter to the getUrl method.
Here is an example that would link to the customer account page to a bookmark called “test”.

Mage::getUrl(‘customer/account’, array(‘_fragment’ => ‘test))

The url generated by the above code would be