Developers

Page

This object represents page. On every page view, there exists a propety named page which gives access to current page properties.

blog?

Returns true if page is a blog.

data

Returns custom data bound to page.

elements_page?

Returns true if page is an elements page.

persisted?

Returns true if the page is saved.

private?

Returns true if page is protected with password.

content_type

Returns the content type for the current page (common_page, blog, element etc.).

created_at

Returns a date when this page was first created. Use date formatting filter to format the date.

description

Page description information.

hidden?

Returns true if page is hidden from site menu.

id, page_id

Returns the ID of the page.

image

Returns image object that can be attached to page in page settings view.

image?

Returns true or false depending whether image is attached to page.

keywords

Page keywords information. Site keywords are added to page unique keywords.

language_id

Page language ID.

language_code

Returns 2-character code for given page, e.g. 'en' for english, 'ru' for russian, 'et' for estonian language.

layout_title

Returns the name of the page's layout.

level

Page level of location in site tree.

link?

Returns true if the page is actually an external link.

menuitem

Returns the menu item for the current page.

new_record?

Returns true if the page isn't saved yet

node_id

Page node ID.

path

Returns path for given page.

<a href="{{ page.path }}">{{ page.title }}</a>

=> <a href="current/page/path">Current page</a>

Please notice that this is a relative path for this page. We suggest you always to use absolute addresses on your site, which will be generated for you by Voog assuring less broken links. Absolute path for page can be retrieved by using url variable (see below).

path_with_lang

Like path but adds language code for front page path for cross language links consistency.

parent

Returns parent page of the current page or nothing if page is already a top-level page. Returned object is also page type of object.

Go <a href="{{ page.parent.url }}">up one level</a>

site_title

Returns title for site in given language. Should be used when rendering the <title> tag.

<html>
  <head>
    <title>{{ page.site_title }}</title>
  </head>
  ...
</html>

title

Returns title for given page

<html><head><title>{{ page.title }}</title></head>...</html>

=> <html><head><title>Current page</title></head>...</html>

url

Returns URL for given page.

<a href="{{ page.url }}">{{ page.title }}</a>

=> <a href="/site_prefix/current/page/path">Current page</a>

created_at

Returns a date when this page was first created. Use date formatting filter to format the date.

updated_at

Returns a date when this page was last updated. Useful for showing "last updated" timestamps. Use date formatting filter to format the date.

This page was last updated at <b>{{ page.updated_at | date : "%d.%m.%Y" }}</b>

=> This page was last updated at <b>09.11.2008</b>

to_json

Serializes the page into a JSON string.