pub fn unless_user<'reg, 'rc>(
h: &Helper<'reg, 'rc>,
r: &'reg Handlebars<'reg>,
ctx: &'rc Context,
rc: &mut RenderContext<'reg, 'rc>,
out: &mut dyn Output
) -> HelperResult
Expand description
A templating helper that tests if current user’s username does not
match a set of given string(s). It is the negated version of
if_user
.
Usage:
-
{{#unless_user "foo,bar"}}..baz..{{/unless_user}}
Renders
..baz..
only if current user’s username is neither “foo” nor “bar”. -
{{#unless_user "foo"}}..baz..{{else}}..qux..{{/unless_user}}
Renders
..baz..
only if current user’s username is NOT “foo”, renders..qux..
only if current user’s username is “foo”. -
{{#unless_user some.array}}..foo..{{/unless_user}}
Renders
..foo..
only if current user’s username is none of the values from the templating variablesome.array
(defined in the config file’s [[context]
] section).
[[context]
]: dt_core::config::ContextConfig