{credentials:slice_pwd:slice_id}

Description

Registers a slices reading password for the current page so protected content from that slice can be displayed later on the same page. The password is hashed and added to the pages list of known passwords; any view or item expression that reads the matching protected slice afterwards is then allowed to render its items. The expansion itself outputs nothing - it is a side effect only. Useful in the Site module and in views that pull in content from a password-protected slice. The first argument is the plain-text reading password (it must match the slices Reading Password). A second argument appears in the signature but is not used by the current engine. Marked experimental in the source.

Parameters

slice_pwd required default (empty)

The protected slices Reading Password, in plain text. It must match the Reading Password configured for that slice. The engine stores the md5 hash of this value in the pages list of known passwords, so any later expression that reads the protected slice is allowed to display its items.

slice_id optional default (empty)

Shown in the signature but not used by the current engine - the expansion registers only the password from the first argument. Documented here for completeness; supplying it has no effect. The target slice is identified implicitly by whichever slice has a matching Reading Password.

Examples

test[{credentials:DobreslO}]
Expected[]
Actual[]
The command produces no visible output. It only registers the password as a side effect, so the brackets stay empty.
test{credentials:DobreslO}Done.
ExpectedDone.
ActualDone.
Whatever password you pass, the expansion result is an empty string, so only the text after it (Done.) shows. The work happens behind the scenes.
test[{credentials:DobreslO:09b3d04267f5a8a7c2c0488019f74440}]
Expected[]
Actual[]
The signature shows a second slice_id argument, but the current engine does not use it - only the first argument (the password) is registered. Output is still empty.
virtual{credentials:DobreslO}{view:1234:0a1b...}
Expected(the protected items, e.g. their headlines)
Real-world pattern: put credentials at the top of a view or Site page body, then read the protected content below it. Without the matching reading password registered first, the protected slice returns nothing. The password here must equal the slices Reading Password (set in slice administration). Output of credentials itself is always empty; the visible result is whatever the following view or item expression returns.