misago.core.page.Page
, which contains list of all sections belonging to it. Those instances are misago.users.sites.usercp
, misago.users.sites.users_list
and misago.users.sites.user_profile
.misago.core.page.Page
instances expose following API:add_section(link, after=None, before=None, visible_if=None, get_metadata=None, **kwargs)
after
and before
arguments should be value of other page link
. visible_if
argument accepts callable that will be called with args passed to get_pages
function on page render to resolve if link to page should be displayed. get_metadata
can be callable returning additional computed metadata for this page. All other values passed to function call get preserved in order to make it easy for 3rd party developers to reuse mechanic for their apps.visible_if
and get_metadata
functions are called with arguments that were passed to get_sections
method.get_sections(request, *args)
add_section
with additional is_active
argument that controls if selected page is displayed one and metadata
dict if one is defined.get_default_link()
USERCP_URL
- Default link to user control panel site.USERS_LIST_URL
- Default link to users lists site.USER_PROFILE_URL
- Default link to user profile site.