Home > Site management > Themes > Variable reference > Page attributes
login

© Metadot Corporation

Page object represent the current page. This object is not visible for text assets, but is fully accessible for layouts.
Page attributes:

title  

Returns the title of the current page

Example usage:

<title>{{site.name}} - {{page.title}}</title>

Html output:

<title>Wiki - Home</title>

meta_description  

Returns the meta description of the current page

Example usage:

<meta name="Description" content="{{page.meta_description}}"/>

Html output:

<meta name="Description" content="Wiki machine is a Metadot wiki software"/>

meta_keyword  

returns the meta keywords of the page

Example usage:

<meta name="Keywords" content="{{page.meta_keyword}}"/>

Html output:

<meta name="Keywords" content="wiki, software, machine, Metadot"/>

level_deep  

returns the level of the page

Example usage:

{% if page.level_deep >= 2 %}
...
{% endif %}

local_nav  

returns list of links to all sub pages (1 level deep) of current page

Example usage:

{{page.local_nav}}

Html output:

<ul class='navigation_menu'>
<li class='first'><a href='/sample-page/first_page'>first page</a></li>
<li class='current'><a href='/sample-page/second'>second</a></li>
<li><a href='/sample-page/third'>third</a></li>
<li class='last'><a href='/sample-page/help>help</a></li>
</ul>

local_nav_2  

the same as local_nav, but returns 2 levels deep tree of sub-pages

local_nav_3  

the same as local_nav, but returns 3 levels deep tree of sub-pages

page_local_nav_unlimited  

the same as local_nav, but returns unlimited levels deep tree of sub-pages

global_nav  

returns list of links to all first level pages

Example usage:

{{page.global_nav}}

Output html:

<ul class='navigation_menu'>
<li class='first'><a href='/sample-page/'>Home</a></li>
<li class='current'><a href='/sample-page/second'>second</a></li>
<li><a href='/sample-page/third'>third</a></li>
<li class='last'><a href='/sample-page/help>help</a></li>
</ul>

global_nav_unlimited  

same as global_nav, but shows the whole tree of site pages

local_nav_as_table_horizontal  

returns table of links to all sub pages of current page. All links reside in one table row.

Example usage:

{{page.local_nav_as_table_horizontal }} 

Html output:

<table class='navigation_menu' cellpadding=0 cellspacing=0>
<tr><td class='first'><a id='current' href='/'>Home</a></td>
<td ><a href='/sample-page'>Sample Page</a></td>
<td ><a href='/marketing-materials'>Marketing Materials</a></td>
<td ><a href='/faqs'>FAQs</a></td>
<td ><a href='/about-us'>About Us</a></td>
<td class='last'><a href='/support'>Support</a></td>
</tr></table>

global_nav_as_table_horizontal  

same as local_nav_as_table_horizontal, but returns links to all first level pages

local_nav_as_table_vertical  

returns table of links to all sub pages of current page. Each links resides in separate table row.

Example usage:

{{page.local_nav_as_table_vertical}}

Html output:

<table class='navigation_menu' cellpadding=0 cellspacing=0>
<tr><td class='first'><a id='current' href='/'>Home</a></td>
</tr><tr><td ><a href='/sample-page'>Sample Page</a></td>
</tr><tr><td ><a href='/marketing-materials'>Marketing Materials</a></td>
</tr><tr><td ><a href='/faqs'>FAQs</a></td>
</tr><tr><td ><a href='/about-us'>About Us</a></td>
</tr><tr><td class='last'><a href='/support'>Support</a></td>
</tr></table>

 

global_nav_as_table_vertical  

the same as local_nav_as_table_vertical, but returns links to all first level pages

breadcrumb  

returns html fragment containing path from the home to the current page. Will be empty if current page is the home page

Example usage:

{{page.breadcrumb}} 

Html output:

<a class='first' href='/'>Home</a>
> <a href='/sample-page'>Sample Page</a>
> <span class='last'>Another Page</span>

 

breadcrumb1  

same as breadcrumb, but will be empty if there is only two pages in the path

breadcrumb2  

same as breadcrumb, but will be empty if there is only three pages in the path

login_menu  

return the login menu

Example usage:

{{page.login_menu}}

Html output:

Welcome, <span class="welcome-user">John Smith</span> | <a href='/__metadot__/tech/feedback?redirect=/sample-page/another-page'>send feedback</a> | <a href='/__metadot__/tech/manage'>manage</a> | <a href='/__metadot__/me'>profile</a> | <a href='/__metadot__/login/logout'>logout</a>

 

url  

returns url to the current page

Example usage:

{{page.url}} 

Html output:

/sample-page/another-page

rss  

returns html fragment with the linked image which points to the rss feed of the current page

Example usage:

{{page.rss}} 

Html output:

<a href='/sample-page/another-page.rss' target='_blank' style='border:0'><img src='/__metadot__/images/rss.png' border=0 /></a>

 

rss_url  

returns the url of the rss feed of the current page

Example usage:

{{page.rss_url}} 

Html output:

/sample-page/another-page.rss

 

edit_mode_or_has_local_nav_or_has_gizmos_in_area_  

Return true if:

  • the page is in edit more or
  • has sub-pages
  • or there are gizmos in area X
This function is useful for example in case we need to hide empty gizmo areas.

Example usage:

{% if page.edit_mode_or_has_local_nav_or_has_gizmos_in_area_2 %}...{% endif %} 

edit_mode_or_has_gizmos_in_area_(1-3)  

Return true if the page is in edit more or there is gizmos in area 1 - 3. This function is useful for example in case we need to hide empty gizmo areas.

Example usage:

{% if page.edit_mode_or_has_gizmos_in_area_2 %}...{% endif %}

js_and_css  

generates all needed javascript and css tags. Works the same way as the function "js_and_css ".

Example usage:

<head>
...
{{page.js_and_css}}
...
</head>