This project is read-only.

Theory: Cartography

This project provides a new hierarchical menu system, built using Mechanics connectors.

It's intended primarily as an example of how to use the features of Science Project and how to override templates; but it's a working system and extremely flexible.

Under the surface, it works by creating the following:
  1. SiteToMenuRoot and MenuRootToSite connectors. These allow you to attach top-level menu items to the Site content item itself. These are rendered to the Navigation zone using Paperclips - you can easily change the zone and display type by editing the PaperclipPart settings on the SiteToMenuRoot content type.
  2. MenuChild and MenuParent connectors. These allow you to create sub menus leading off the menu root.
  3. By default only Page content items are enabled for participation in menus. When you edit a Page, you'll see UI options for specifying Site parent (to attach the page as a top-level menu item), Menu parent (to attach the page as a sub-menu item) and Menu children (to attach sub-menus to that page). When you select an item from the list and click Save, you will then get UI for editing the menu caption.
  4. If you want content types other than Page to appear in the menu, just edit the Connector settings on SiteToMenuRoot, MenuRootToSite, MenuChild and MenuParent - you can change the allowed content types settings to a comma-separated list of other content types. Don't change the "Site" endpoints as this may produce unexpected behavior! ...Although you could use the same principles as shown here to create other types of menus. You could also add PaperclipPart to the MenuChild content type to display a sidebar menu!
  5. Delete all your original menu items from Navigation in the Dashboard - otherwise they'll still display in addition to the Mechanics menus.
  6. When you hover over menu items, the Impulses will appear - the "Edit" and "Edit Connector" links are shortened to "E" and "C" respectively, this is so you can conveniently edit items in the menus. These will be replaced with icons in a future version.

Last edited May 26, 2011 at 2:27 PM by randompete, version 1

Comments

No comments yet.