{slice:property}

Description

Returns a property of the current slice - the slice that the rendering item or view belongs to. Outside an item context it uses the active slice_id; if no slice is in scope it returns an empty string. With no property given, or any unrecognized property name, it returns the slice name. Supported properties: name (the slice title), url (the slice public URL setting, stored as slice_url), site_ids (dash-joined id(s) of the site module(s) the slice belongs to; site_id is an older single-value alias), charset (the slice character set). A property that starts with an underscore reads that slice setting value. This command takes no slice id - it always reads the current slice. To read a named slice by its id, use the preferred modulefield:slice_id:property, which this command is a thin wrapper over.

Parameters

property optional default name

Which slice property to return. Defaults to the slice name. Recognized: name, url, site_ids, charset. A name starting with an underscore reads that slice setting. Any other value returns the slice name.

Examples

test{slice:name}
ExpectedAA Expressions Examples
ActualAA Expressions Examples
With no property or the name property, returns the title of the current slice (the slice the rendering item or view belongs to). Here that is the documentation Examples slice.
test{slice}
ExpectedAA Expressions Examples
ActualAA Expressions Examples
Omitting the property is the same as asking for name.
testSection: {slice:name}
ExpectedSection: AA Expressions Examples
ActualSection: AA Expressions Examples
A common real use - prefix or label output with the current slice title.
test{slice:charset}
Expectedutf-8
Actualutf-8
Returns the slice character set.
test{slice:site_ids}
Expectede23064a57a7a468976ce0712eef44932
Actuale23064a57a7a468976ce0712eef44932
Dash-joined id(s) of the site module(s) the slice belongs to (site_id is an older single-value alias). The value shown is specific to this install.
test[{slice:url}]
Expected[]
Actual[]
The url property returns the slice public URL setting (slice_url). It is empty when the slice has no URL configured, as here. The brackets make the empty result visible.
test[{slice:nonsense}]
Expected[AA Expressions Examples]
Actual[AA Expressions Examples]
Trap - any property that is not name, url, site_ids, site_id, charset, or an underscore slice setting falls back to the slice name. It does not error or return empty.
test{modulefield:9e1d2b9f88e3d6c3bf0eb967378610d6:name}
ExpectedAA Test Data - Stable
ActualAA Test Data - Stable
slice takes no id - it always reads the current slice. To read a specific slice by id, use the preferred modulefield:slice_id:property (slice is a thin wrapper over it). Here it returns the title of the fixture slice 9e1d2b9f.
Deprecated: Yes - prefer modulefield:slice_id:property, which takes an explicit slice id. Alternative: modulefield, site, charset