Page contents#

class cms.models.contentmodels.PageContent(id, language, title, page_title, menu_title, meta_description, redirect, page, creation_date, created_by, changed_by, changed_date, in_navigation, soft_root, template, limit_visibility_in_menu, xframe_options)#
content_indicator()#

returns the content indicator status. Without additional packages like djangocms-versioning page content always is public.

Return type:

str

get_absolute_url(language=None)#

Get the absolute url for the page content. If language is specified it will return the absolute url of the corresponding “sister” content.

get_template()#

get the template of this page if defined or if closer parent if defined or DEFAULT_PAGE_TEMPLATE otherwise

get_template_name()#

get the textual name (2nd parameter in get_cms_setting(‘TEMPLATES’)) of the template of this title. failing to find that, return the name of the default template.

get_xframe_options()#

Finds X_FRAME_OPTION from tree if inherited

is_editable(request)#

returns True if page content object itself can be edited. Does not check user permissions to do that.

Return type:

bool

rescan_placeholders()#

Rescan and if necessary create placeholders in the current template.

save(**kwargs)#

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.

toggle_in_navigation(set_to=None)#

Toggles (or sets) in_navigation and invalidates the cms page cache

admin_manager = <cms.models.managers.ContentAdminManager object>#

Admin_manager does lack additional functionality of objects and must only be used inside admin objects or admin forms. One of its key properties is that it can access all objects of type PageContent (irrespevtively of some objects being hidden by third-party packages, e.g. due to viewing rights, publication or moderation status.

class cms.models.contentmodels.EmptyPageContent(language, page=None)#

Empty title object, can be returned from cms.models.pagemodel.Page.get_content_obj() if required title object doesn’t exist.

content_indicator()#

returns the content indicator status. Empty page content always is empty

Return type:

str

is_editable(request)#

returns True if empty page content object itself can be edited. Since editing creates a new page content object this should always be True

Return type:

bool