In Boomla, files are selected. This is in strong contrast with traditional operating systems, where files are opened. In Boomla, you don’t need to open and close files, you just work with them.
You can select one or more files.
To select a single file, use its path.
To find multiple files, you can use a path with wildcards. You can also throw in some selectors and filters.
Selectors perform a certain function on the context collection. Take, for example,
* is a filter for returning all the children of a given file.
first() is a selector to keep only the first of those.
Filters are used to select 0 or more children of a file.
Note that only a single selector may be present between slashes (
/), but you can use multiple filters.
Select a file by its name.
Select a file by pattern matching its name.
Only match files that are pages. A page is a file if it implements the .Page interface.
Only match files that are contents. A file is a content if it implements the
Select files in a given bucket.
:1 form was used and bucket names were numbers. Later, we elevated buckets to first class objects and moved to using the
main: form that allows using string bucket names.
Select the root file of any website. Must be at the beginning of a query string. Note that access control may prevent you from selecting remote websites.
Select the root file of the current filesystem scope. For package filesystems, this means the root file of the package filesystem, not that of the entire website.
/ selector is only treated as the root file selector if it is found at the beginning of a query string. The
root() selector may appear anywhere in the query string.
If the file in context has a file type pointing to an app in an installed package, the last example return the root file of the package filesystem. Let’s break it down:
For a given file,
typeChain() returns a collection of all files we encounter when following the file’s type chain.
last() returns the last file of the collection, typically, often an application contained in a package that was installed.
root() will return the root file of that package, for example
You should be able to visit this file in your browser, as it normally contains the package documentation.
Select a file’s parent.
.. parent selector is resolved before the query is evaluated, while the
parent() selector is resolved at evaluation time. Thus,
parent()/.. is not equivalent to
foo/parent()/.. is simplified to
foo before it is evaluated.
foo/../parent() is simplified to
parent() before it is evaluated.
Follow the file’s type reference.
Return all the files along the file’s type chain, including self.
Returns the first file from the collection.
Returns the last file from the collection.