Unusual Subroutines

The blog and musings of Christopher Allen-Poole

How to create a menu item.

Wanted to add a menu item to my blog which pointed to the blog itself. Mostly just for quick reference. Here's the code:

@hooks.register('register_admin_menu_item')
def register_frank_menu_item():
      # This ID is hard coded (for now).
      return MenuItem('Blog-contents', '/blog_admin/pages/4/', 
                      classnames='icon icon-folder-open-inverse', order=101)
blog comments powered by Disqus