Toggle table of contents sidebar
Pages¶Bases: MP_Node
A Page
is the basic unit of site structure in django CMS. The CMS uses a hierarchical page model: each page stands in relation to other pages as parent, child or sibling. This hierarchy is managed by the django-treebeard library.
A Page
is an abstract entity. It does not have any content associated with it, nor does is provide any slugs to build a URL. This is part of the model PageContent
and PageUrl
respectively.
Adds a child to the node.
This method saves the node in database. The object is populated as if via:
` obj = self.__class__(**kwargs) `
PathOverflow – when no more child nodes can be added
Adds a new node as a sibling to the current node object.
This method saves the node in database. The object is populated as if via:
` obj = self.__class__(**kwargs) `
PathOverflow – when the library can’t make room for the node’s new position
Copy a page [ and all its descendants to a new location ]
Removes a node and all it’s descendants.
get application urls conf for application hook
get user who last changed this page
get when this page was last updated
Helper function for accessing wanted / current title. If wanted title doesn’t exist, EmptyPageContent instance will be returned.
Returns available languages for the page. This is potentially costly.
Returns path (relative to MEDIA_ROOT/MEDIA_URL) to directory for storing page-scope files. This allows multiple pages to contain files with identical names without namespace issues. Plugins such as Picture can use this method to initialise the ‘upload_to’ parameter for File-based fields. For example:
- image = models.ImageField(
_(“image”), upload_to=CMSPlugin.get_media_path)
where CMSPlugin.get_media_path calls self.page.get_media_path
This location can be customised using the CMS_PAGE_MEDIA_PATH setting
get the menu title of the page depending on the given language
get content for the description meta tag for the page depending on the given language
Helper function for getting attribute or None from wanted/current page content.
get the page title of the page depending on the given language
get redirect
the root node for the current node object.
get the textual name (2nd parameter in get_cms_setting(‘TEMPLATES’)) of the template of this page or of the nearest ancestor. failing to find that, return the name of the default template.
get the title of the page depending on the given language
Get the path of the page depending on the given language
Has user ability to add page under current page?
Has user ability to change permissions for current page?
Has user ability to move current page?
Encapsulates logic for determining if this page is eligible to be set as is_home. This is a public method so that it can be accessed in the admin for determining whether to enable the “Set as home” menu item. :return: Boolean
Called from admin interface when page is moved. Should be used on all the places which are changing page position. Used like an interface to django-treebeard, but after move is done page_moved signal is fired.
Reload a page from the database
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
Sets the given page as the homepage. Updates the url paths for all affected pages. Returns the old home page (if any).
Internal cache for page content objects visible publicly
Internal cache for page urls
Bases: Model
Bases: Page
Encapsulates logic for determining if this page is eligible to be set as is_home. This is a public method so that it can be accessed in the admin for determining whether to enable the “Set as home” menu item. :return: Boolean
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4