Channel.State Example
In this example, we store a DateTime value in the channel state once, to hold the time of the first request on the channel.
Note that this example is not very useful unless included in a code path related to every rendertemplate in a given channel.
Smartsite SXML | Copy Code |
---|---|
<se:if expression="!channel.state.exists(FirstRequest)"> {channel.state.set(FirstRequest, datetime.now())} </se:if> {locale.formatdatetimecustom(channel.state.get(FirstRequest), 'd MMMM yyyy, HH:mm')} |
Example Result | Copy Code |
---|---|
21 oktober 2010, 08:15 |