Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. Using extensions with menus
  2. If you want the extension to show up in the menu (e.g. if you had created an extension that added an icon to the page) use menu modifiers. Every node.id corresponds to their related page.id. Page.objects.get(pk=node.id) is the way to get the page object. Every page extension has a one-to-one relationship with the page so you can access it by using the reverse relation, e.g. extension = page.yourextensionlowercased. Now you can hook this extension by storing it on the node: node.extension = extension. In the menu template you can access your icon on the child object: child.extension.icon.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement