##The page context
Use: {{ post.getType() == 'pages'}} to detect this context.
Whenever you're viewing a static page, you're in the page
context. The page
context is not set on posts, which uses the post context instead.
The URL used to render a static page is always /:slug/
. This cannot be customised, unlike post permalinks.
The default template for a page is page.volt
.
Additionally, you can provide a custom template for a specific page. If there is a pages/slug
file with the slug
matching the static page's slug this will be used instead.
For example, if you have an 'About' page with the url /about/
, adding a template called pages/about.volt
will cause that template to be used for the about page, instead of page.volt.
The page
context provides access to the post object which matches the route. A page is just a special type of post, so the data object is called a post, not a page. See a full list of attributes below:
- id - the incremental ID of the page
- title - the title of your static page (title helper)
- excerpt - a short preview of your page content (excerpt helper)
- content - the content of the page (content helper)
- url - the web address for the static page (url helper)
- thumbnail - the cover image thumbnail with the page (image helper)
- updated_at: - date and time when the page was last updated (date helper)
- created_at: - date and time when the page was created (date helper)
- tags - a list of tags associated with the page (see tags for details)