l.s.w._.NavigationMenu(MenuBase) : class documentation

Part of lp.services.webapp View In Hierarchy

Base class for navigation menus.
Method initLink Undocumented
Method updateLink Called each time a link is rendered.
Method iterlinks See INavigationMenu.
Method _is_current_url Determines if <link_url> is the current URL.
Method _is_menulink_for_view Return True if the menu-link is for the current view.

Inherited from MenuBase:

Method __init__ Undocumented
Method initialize Override this in subclasses to do initialization.
Method _check_links Undocumented
Method _buildLink Undocumented
Method _get_link Undocumented
Method _rootUrlForSite Return the root URL for the given site.
Method _init_link_data Undocumented

Inherited from UserAttributeCache (via MenuBase):

Method account Undocumented
Method user The logged-in Person, or None if there is no one logged in.
def initLink(self, linkname, request_url):
Undocumented
def updateLink(self, link, request_url=None, view=None):
Called each time a link is rendered.

Override to update the link state as required for the given request.

def iterlinks(self, request_url=None):
See INavigationMenu.

Menus may be associated with content objects and their views. The state of a menu's links depends upon the request_url (or the URL of the request) and whether the current view's menu is the link's menu.

def _is_current_url(self, request_url, link_url):
Determines if <link_url> is the current URL.

There are two cases to consider: 1) If the link target doesn't have query parameters, the request URL must be the same link (ignoring query parameters). 2) If the link target has query parameters, the request url must be a prefix of it to be the current url.

def _is_menulink_for_view(self, link, view):
Return True if the menu-link is for the current view.

A link is considered to be selected when the view provides link's menu interface.

ParameterslinkAn ILink in the menu. It has a menu attribute that may have an INavigationMenu assigned.
Unknown Field: viewThe view being tested.
API Documentation for Launchpad, generated by pydoctor at 2019-08-18 00:00:05.