• ♡ Sponsor

    Filters

    #Filter #Object #Pagelist

    The filters object is a unique list of tags associated with pages of the current pagelist. A good example of the usage of the filters object can be found here. You can use the :filter variable to get the current filter tag while looping over the filters object.

    Example

    <@ foreach in filters @>
        <a href="?<@ queryStringMerge { filter: @{ :filter } } @>">               
            @{ :filter }
        </a>
    <@ end @>
    

    Related

    Toolbox  ⁄
    filelist — Toolbox

    Updates the configuration of the filelist object. A foreach loop can be used to iterate over the files in the list. This method has no output.

    Toolbox  ⁄
    newPagelist — Toolbox

    Creates a new pagelist object. The current pagelist will be replaced. A foreach loop can be used to iterate over the pagelist object. This method does not have any output. To only update the configuration of the current pagelist, without resetting all other parameters, the ...

    Toolbox  ⁄
    pagelist — Toolbox

    Modifies the currently defined pagelist pagelist object. Only specified options will be changed, all others will be preserved. To restore a default pagelist and reset all options, the newPagelist method can be used.

    Toolbox  ⁄
    queryStringMerge — Toolbox

    Creates a query string containing the specified paramters as key/value pairs merged with the existing query string of the current URL. This method can be used to create links for adding or replacing some parameters of the query string without touching the other ones. A standard ...

    Template Language  ⁄
    Objects — Template Language

    Objects in Automad are conceptually just lists containing iteratable items to be used in foreach loops. Such lists are automatically populated with default sets of elements while rendering a page. They always exist. The actual content of any object is depending on the current ...

    Objects  ⁄
    Pagelist — Objects

    The pagelist contains by default all pages which are not hidden and therefore has no defined type. Changing the pagelist type to one of the following available types will update the selection of pages accordingly. The main purpose of this object is to provide an easy way of ...

    Objects  ⁄
    Filelist — Objects

    The filelist contains by default all image files of the current page. The selection of files can be modified by using the filelist function. Check out this detailed example of how to use a filelist. Similar to the pagelist object, it is possible to get the number of files in the ...

    Objects  ⁄
    Tags — Objects

    The tags object contains all tags associated with the current page in the context. When iterating over the list of tags, the current tag can be adressed by using the :tag variable.

    Control Structures  ⁄
    foreach — Control Structures

    The foreach loop iterates over objects. Depending of the type of the object in use, Automad provides different runtime variables within the code block of the loop to refer to items of the object. The :i variable refers to the index of the current iteration in the loop.

    Template Language  ⁄
    Recursive Navigations — Template Language

    Navigations and menus represent an essential part of any webiste. Automad provides convenient methods to iterate over the collection of pages recursively and therefore allows for creating site trees in a few simple steps. The basic concept behind a navigation tree in Automad is ...

    • Automad
    • Developer Guide
    • Building Themes
    • Template Language
    • Objects
    • Filters
    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 ←
  • Objects
  • Pagelist
  • Filelist
  • Tags
  • Filters