• ♡ Sponsor

    Toolbox

    #Method #Statement

    The Toolbox provides a collection of essential functions for templates. While some are just convenient shorthand functions for more complex statements, others provide the main interface to interact with objects, create redirects and work with query strings.

    <@ function { options } @>
    

    Like all statements, Toolbox functions are always wrapped in Automad's statement delimiters. Options can be passed as a kind of "dirty" JSON object. Note that the keys are not quoted here. It is also possible to use variables as values. Variables only need to be quoted when concatenated with other strings.

    <@ function {
        key: @{ variable },
        anotherKey: "@{ variable } in a string"
    } @>
    

    More in Toolbox

    • breadcrumbs
    • filelist
    • img
    • nav
    • navChildren
    • navSiblings
    • navTop
    • navTree
    • newPagelist
    • pagelist
    • queryStringMerge
    • redirect
    • set

    Related

    Template Language  ⁄
    Control Structures — Template Language

    As in other languages, control structures in Automad are statements that dynamically determine the flow of an application or website based on evaluating content or variables. Automad knows four different statements to control the flow of the application: for, foreach, if and ...

    Template Language  ⁄
    Snippets — Template Language

    The snippet statement allows for defining reusable code snippets and is therefore also the basis for any kind of recursion in Automad. A snippet always inherits the context of the calling code. To use a snippet, it is enough to put the snippet's name in statement delimiters.

    Template Language  ⁄
    Includes — Template Language

    In many cases, different templates across a theme use recurring components such as a header, a navbar or a footer. Those elements can be stored in separate files and included whenever needed. To include such an external snippet, simply wrap its path relative to the current file ...

    Template Language  ⁄
    Using Extensions — Template Language

    Extensions provide a convenient way of turning custom PHP code into Automad statements. Besides the fact that extensions have to be called by their names including their namespace, the syntax is the same as for Toolbox or pipe functions.

    • Automad
    • Developer Guide
    • Building Themes
    • Template Language
    • Toolbox
    Discuss
    Packages
    Release Notes
    Support
    Terms of Use
      Become a Sponsor
      GitHub
      Twitter
      Facebook
      Instagram
      2013-2022 by Marc Anton Dahmen
    Released under the MIT license

    A faceless machine, creating one's portrait in the internet.
  • Automad
  • Getting Started
  • System
  • User Guide
  • Developer Guide
  • Headless Mode
  • Discuss
  • Packages
  • Developer Guide ←
  • Building Themes ←
  • Template Language ←
  • Toolbox
  • breadcrumbs
  • filelist
  • img
  • nav
  • navChildren
  • navSiblings
  • navTop
  • navTree
  • newPagelist
  • pagelist
  • queryStringMerge
  • redirect
  • set