tmpn
Sets a scratchpad variable to the value specified in the tag body.
The variable will not be saved into the user's session
and will therefore only be valid for the remainder of the current page.
This tag will not interpolate
its body text by default.
Summary
- [tmpn name] string to save [/tmpn]
| Parameter
|
Description
|
Default
|
| name |
The name of the scratchpad variable you would like to set. |
None |
| interpolate |
Parse Interchange tags, included in the body text, before this container tag executes. |
No
|
Examples
Tag expansion example
|
[tmpn foo] Hello world [/tmpn]
|
The above sets up for the following example of a subsequent retrieval:
[scratch foo]
|
|
Hello World
|
The following example demonstrates that the tag does not
interpolate its body text by default:
[value name="bar" set="Joe" hide=1]
[tmpn foo] Good Morning, [value bar]! [/tmpn]
[scratch foo]
|
|
Good Morning, [value bar]!
|
If the [tmp] tag had been used then the result would have been:
Perl example
$Tag->tmpn({
name => $name,
body => $value,
});
|
or similarly with positional parameters:
|
$Tag->tmpn($name, $value);
|
Description
Sets a scratchpad variable to the value specified in the tag body.
This is just as the [set] tag would do it,
except that the name is added to the list of scratchpad entries that are to be
deleted immediately after the current page has been processed and served.
This saves session write time in many cases.
This tag does not interpolate
automatically.
Interpolation can be turned on by either passing the interpolate=1
parameter, or by simply using the [tmp] tag instead.
|
Note
The [tmpn] tag is not appropriate for setting scratchpad-based
order/search profiles or
mv_click
/
mv_check
callback actions.
If you want to define these but not store them in the users' session
then use a profile instead.
See the [OrderProfile] and [SearchProfile]
local configuration directives.
|
The "set
scratchpad variable" tags are all very similar.
The following table will help you select the one that's correct for your
requirements:
| Tag name
|
Temporary
|
Interpolates
|
| set |
No
|
No
|
| seti |
No
|
Yes
|
| tmpn |
Yes
|
No
|
| tmp |
Yes
|
Yes
|
Parameters
name
The name of the scratchpad variable whose value you want to set.