Toolbox
class Toolbox (View source)
The Toolbox class holds all methods to be used within the template files.
Properties
private | $Automad | Automad object. | |
private | $collection | The full collection of pages. |
Methods
The Automad object is passed as an argument. It shouldn't be created again (performance).
Generate breadcrumbs to the current page, if the page's level is > 0 (not homepage / search results / page not found).
Configure the filelist to be used in foreach loops.
Place an image.
Generate a list for the navigation below a given URL.
Generate a list for the navigation below the current page.
Generate a list for the navigation below the current page's parent.
Generate a list for the navigation at the top level including the home page (level 0 & 1).
Generate full navigation tree.
Alias for calling the pagelist() method with the default options merged with the specified ones to override all previous configurations.
Change of configuration for Automad's Pagelist object.
Merge passed key-value pairs ($options) with current query string.
Redirect page.
Set shared or session data variables by passing an array of key/value pairs.
Details
at line 72
__construct(Automad $Automad)
The Automad object is passed as an argument. It shouldn't be created again (performance).
at line 87
string
breadcrumbs(array $options = array())
Generate breadcrumbs to the current page, if the page's level is > 0 (not homepage / search results / page not found).
Options: - class: false (class of
<
ul> element) - excludeHidden: false (exclude hidden pages)
at line 123
filelist(array $options = array())
Configure the filelist to be used in foreach loops.
at line 140
string
img(array $options = array())
Place an image.
Options: - file: false (filepath or glob pattern - when using a glob pattern, the first match is used) - width: false (width in pixels) - height: false (height in pixels) - crop: false (crop image) - class: false (class for the element)
at line 183
string
nav(array $options = array())
Generate a list for the navigation below a given URL.
Options: - context: '/' (The parent URL) - hompage: false (include homepage to first-level nav) - excludeHidden: true (exclude hidden pages) - class: false (class of the
<
ul> element) - active: false (class of the active
at line 243
string
navChildren(array $options = array())
Generate a list for the navigation below the current page.
Options are the same like those for nav() except the 'context' option.
at line 255
string
navSiblings(array $options = array())
Generate a list for the navigation below the current page's parent.
Options are the same like those for nav() except the 'context' option.
at line 267
string
navTop(array $options = array())
Generate a list for the navigation at the top level including the home page (level 0 & 1).
Options are the same like those for nav() except the 'context' option.
at line 286
string
navTree(array $options = array())
Generate full navigation tree.
Options: - all: true (expand all pages or only in current path) - context: '' (parent URL) - rootLevel: false (a kind of flexible context page at a given level) - excludeHidden: true (exclude hidden pages) - class: false (class of the
<
ul> element) - active: false (class of the active
at line 367
newPagelist(array $options = array())
Alias for calling the pagelist() method with the default options merged with the specified ones to override all previous configurations.
at line 390
pagelist(array $options = array())
Change of configuration for Automad's Pagelist object.
Options:
- context: an optionally fixed URL for the context of a pagelist of type breadcrumbs or children. In case this parameter is false, within a loop the context always changes dynamically to the current page.
- excludeCurrent: default false
- excludeHidden: default true
- filter: filter pages by tags
- limit: limit the object's array of relevant pages
- offset: offset the within the array of all relevant pages
- page: false (the current page in the pagination - to be used with the limit parameter)
- search: filter pages by search string
- sort: sorting options string, like "date desc, title asc"
- template: include only pages matching that template
- type: sets the type of pagelist (default is false) - valid types are false (all), "children", "related", "siblings" and "breadcrumbs"
at line 400
string
queryStringMerge(array $options)
Merge passed key-value pairs ($options) with current query string.
at line 409
redirect(array $options)
Redirect page.
at line 426
set(array $options)
Set shared or session data variables by passing an array of key/value pairs.