{site:site_ids:property}

Description

Lists the slices that belong to one or more sites. A site is a Site-module group that ties slices together (shared navigation, friendly URLs, cross-slice search). The first argument is one or more site ids, dash-separated; the second argument is the property to read. Only the property modules is recognized: it returns the dash-separated ids of every ACTIVE slice related to those sites. Any other property, a missing property, an empty site id, or an id that is not a site returns an empty string. The site itself is not included in the list. The most common use is feeding this list into another command, for example count to count the slices in a site, ifin to test whether a given slice belongs to a site, or ids to search across every slice of a site at once. AA core uses it together with modulefield to compute seo names and to scope backlink searches to all sibling slices of an item.

Parameters

site_ids required default (none - required)

One or more site ids, dash-separated. A site is a Site-module group; its id is the module id of the site, which you can read from a slice with the modulefield command (the site_ids property). Pass several ids joined by - to list slices across multiple sites at once. An empty value, or an id that is not a site, yields an empty result.

property required default (none - only modules is recognized)

Names what to read about the site. The only recognized value is modules, which returns the dash-separated ids of every active slice in the site. Any other value, or an omitted property, returns an empty string.

Allowed values modules - returns the dash-separated ids of every active slice in the site. This is the only recognized property.

Examples

test{count:{site:e23064a57a7a468976ce0712eef44932:modules}}
Expected6
Actual6
The typical use: feed the modules list into count to learn how many slices belong to a site. Here the site e23064... is the Expression Reference site, which currently groups 6 slices.
test{count:{site:{modulefield:9e1d2b9f88e3d6c3bf0eb967378610d6:site_ids}:modules}}
Expected6
Actual6
The canonical pattern AA core uses: modulefield reads the site_ids of a slice, then site lists every slice in that site. Counting them gives the number of sibling slices (including the starting slice). This is how backlinks scopes its search to all slices in the item site.
test{ifin:{site:e23064a57a7a468976ce0712eef44932:modules}:2f3fef5ba522680d1dd5f681a814bf84:in:out}
Expectedin
Actualin
Membership test. ifin takes the site modules list as its haystack and a slice id as the needle. Here slice 2f3fef5b... (the Examples slice) is part of the site, so the result is in. Note the argument order: the list comes first, the id you are looking for second.
test{ifin:{site:e23064a57a7a468976ce0712eef44932:modules}:00000000000000000000000000000000:in:out}
Expectedout
Actualout
The same membership test with an id that is not in the site returns the else branch. A fake all-zero id is never a real slice, so the answer is out.
test[{site:9e1d2b9f88e3d6c3bf0eb967378610d6:modules}]
Expected[]
Actual[]
site expects a SITE id, not a slice id. Slice 9e1d2b9f... is an ordinary slice, not a Site-module group, so it has no related modules and the result is empty (shown here inside brackets to make the empty string visible).
test[{site:e23064a57a7a468976ce0712eef44932}]
Expected[]
Actual[]
Without a second argument site returns nothing. The property argument is required; modules is the only value that produces output.
test[{site:e23064a57a7a468976ce0712eef44932:name}]
Expected[]
Actual[]
Only the property modules is recognized. Any other property name, such as name here, returns an empty string rather than an error.
test[{site::modules}]
Expected[]
Actual[]
An empty site id yields an empty result. This is the safe no-op when the id you pass in (often from another command) turns out to be blank.
virtual{site:e23064a57a7a468976ce0712eef44932:modules}
Expected(dash-separated slice ids, e.g. 9eb077b2...-15deb349...-2f3fef5b...-402caacf...-9e1d2b9f...-133d91fa...)
Actual9eb077b2fd21d909d3b11f54f3c55e1b-15deb349ab0e1a90329f1635b9502be6-2f3fef5ba522680d1dd5f681a814bf84-402caacffa2f9ae22b81b597b3264186-9e1d2b9f88e3d6c3bf0eb967378610d6-133d91fa4fe87a808ed721a5efaf2016
The raw output is a dash-separated list of the active slice ids in the site. Marked illustrative because the exact ids and their number depend on which slices currently belong to the site. In practice you rarely print this list directly; you feed it into count, ifin, or ids.