API


Functions

menus(page, start_level=1, end_level=15)

returns : html
description : Return a formatted ul tag with the menu contents. Active li’s have the active class on them.
example :

{{ page | menus, 1, 1 }}


Account

name

returns : string
description : Returns the name of the account
example :

<body id="{{account.name}}">


Page

name

returns : string
description : Returns a string with the current page’s name
example :

<body id="{{page.name}}">

id

returns : string
description : Returns a string with the current pages id
example :
<h1 id="page_{{page.id}}">{{page.name}}</h1>

url

returns : string
description : Returns a string of the current page’s url
example :

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

urlname

returns : string
description : Returns a string of the current page’s name formatted for URL.
example :

{{page.urlname}}

level

returns : number
description : Return the depth of the current page. Root level is 0.
example :

<div class="level{{page.level}}" />

account

returns : account (drop)
description : Return the account associated with the current page.
example :

page.account

edit_link

returns : string
description : Returns URL to the edit mode of the current page
example :

<a href="{{ page.edit_link }}" id="edit_link">Edit</a>

admin_link

returns : string
description : Returns URL to the admin section for the current page
example :

<a href="{{ page.admin_link }}" id="admin_link">Admin</a>

root?

returns : boolean
description : Return true if page is a root page.
example :

page.root?

root

returns : page (drop)
description : Returns the root ancestor of the current page.
example :

page.root

children?

returns : boolean
description : Return true if page has any sub-pages.
example :

{% if page.children? %}I have kids.{% end %}

children

returns : hash (of page drops)
description : Return a hash of the sub-pages of the current page.
example :

{% if page.children? %} <em>I have {{page.children.length}} sub-pages.{% end %}

has_parent?

returns : boolean
description : Return true if the page has a parent page.
example :

{% if page.has_parent? %} <strong>I have a parent.</strong> {% end %}

parent

returns : page (drop)
description : Return the parent page.
example :

My Mom's name is {{page.parent.name}}!