Moves sort hyperlinks out of main template and into each box (via reusable function).