Collections

filelist
Updates the configuration of the filelist collection. A foreach loop can be used to iterate the files in the list. This method has no output.
newPagelist
Creates a new pagelist object. The current pagelist will be replaced. A foreach loop can be used to iterate 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 pagelist method can be used instead.
pagelist
Modifies the currently defined 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.
Collections
Collections are lists of items that can be iterated using foreach loops. They always exist and are automatically populated with a default set of items when a page is rendered. The actual content of a collection depends on the current context and can be modified, sorted and filtered using the matching functions.
Pagelist
The pagelist contains by default all pages that are not hidden and has no specific type. Changing the type of the pagelist updates the selection of pages accordingly. The main purpose of the pagelist is to provide an easy way of iterating a defined set of pages using a foreach loop, for example to build navigations, blog indexes, search results or lists of related pages.
Filelist
The filelist contains by default all images that are attached to the current page. The selection of files can be changed using the filelist function, which accepts one or more comma-separated glob patterns as well as a sort order. A foreach loop can then be used to iterate the files in the list.
Tags
The tags collection contains all tags that are assigned to the page in the current context. When iterating the tags using a foreach loop, the current tag can be accessed using the :tag variable.
Filters
The filters collection is a unique and alphabetically sorted list of all tags that are assigned to the pages in the current pagelist. While iterating the filters using a foreach loop, the current tag can be accessed using the :filter variable. The filters collection is typically used to build a filter menu for a pagelist.
foreach
The foreach loop iterates collections and lists of files. Depending on the type of list, Automad provides different runtime variables within the code block of the loop to refer to the current item. The :i variable always contains the index of the current iteration.