fluent_pages.models.navigation¶
The data model to walk through the site navigation.
These objects only return the relevant data for the menu/breadcrumb in a fixed, minimalistic, API so template designers can focus on that.
To walk through the site content in Python code, use the Page
model directly.
It offers properties such as parent
and children
(a RelatedManager
),
and methods such as get_parent() and get_children() through the MPTTModel base class.
The NavigationNode
class¶
-
class
fluent_pages.models.navigation.
NavigationNode
¶ The base class for all navigation nodes, whether model-based on virtually inserted ones.
-
get_children
()¶ Provided for compatibility with mptt recursetree
-
get_level
()¶ Provided for compatibility with mptt recursetree
-
children
¶ The list of children.
-
has_children
¶ Whether the node has children.
-
is_active
¶ True if the node is the currently active page.
-
is_child_active
¶ True if a child of this node is the currently active page.
-
is_draft
¶ True if the node is a draft item.
-
is_published
¶ True if the node is a normal published item.
-
level
¶ The depth of the menu level.
-
parent
¶ The parent node.
-
slug
¶ The slug of the node.
-
title
¶ The title of the node.
-
url
¶ The URL of the node.
-
The PageNavigationNode
class¶
-
class
fluent_pages.models.navigation.
PageNavigationNode
(page, parent_node=None, max_depth=9999, current_page=None, for_user=None)¶ An implementation of the
NavigationNode
forPage
models.-
__init__
(page, parent_node=None, max_depth=9999, current_page=None, for_user=None)¶ Initialize the node with a Page.
-
children
¶ The list of children.
-
has_children
¶ Whether the node has children.
-
is_active
¶ True if the node is the currently active page.
-
is_child_active
¶ True if a child of this node is the currently active page.
-
is_draft
¶ True if the node is a draft item.
-
is_published
¶ True if the node is a normal published item.
-
page
¶ New in version 0.9: Provide access to the underlying page object, if it exists.
-
parent
¶ The parent node.
-