Skip to main content
WEBSALE templates have no variables in the sense of a programming language. What they have instead are the free DesignControl parameters: named slots into which you put any value so you can output it later or bracket on it. There are two kinds, and they differ in exactly one respect. Everything else is identical. Both understand the same suffixes, both are written the same way, both behave the same way. This page therefore describes both together and writes DC-FPX wherever DC-SPX applies equally.
The X in the tag name is a placeholder that you fill in yourself. DC-FP1, DC-FPfarbe and DC-FPmeinWert are three different parameters. Digits, letters and combinations of both are allowed, up to 20 characters long.

The pattern in three steps

A free parameter is set, used and released again.
A parameter only applies from the point at which it is set. A bracket further up in the source code does not see the value. This is the most common reason why a query “doesn’t work”.
The comparison in the brackets is case-insensitive. {DC-FP1(Blau)} also applies to the values blau and BLAU. The same goes for the tag name itself and for all suffixes: ~DC-FP1_HexEncode~ and ~DC-FP1_hexencode~ are the same tag.

Brackets without a parameter mean “is filled”

If you leave the brackets empty, the tag only checks whether any value is set at all.
This is the usual way to combine several conditions into one switch: set the same tag in several places, then bracket on it once.

The complete example

A nutrition table should only appear if at least one of four custom product data fields is filled. The query has to enclose the entire block, so the switch is set beforehand.

FP or SP

Use DC-FP as long as the value does not leave the page. That is the normal case. You need DC-SP when the value must still be there on a subsequent page, for example a selection the buyer makes on the product page that should still apply in the basket.
The difference is reversed when resetting. A DC-FP disappears with the template on its own; a second template starts again with an empty slot. A DC-SP stays set for the whole session. If you want to give it a new value on another page, you must first clear it there with ~DC-SPX_reset~.
There is a configurable upper limit for the number of DC-SP parameters. If it is exceeded, the shop no longer creates further parameters, writes a critical error to the log, and the tag has no effect. This limit does not apply to DC-FP.

The output is HTML-encoded

Every free parameter is HTML-encoded on output. If you set ~DC-FP1_set(&)~, & appears on the page.
With domains, URLs and anything that goes into an href attribute or into JavaScript, this leads to surprises. The protection is intentional: it prevents third-party input from being executed as HTML.
Only if you really need the value unchanged and have made sure yourself that it is harmless should you lift the encoding for exactly one output.
Reference: WS-DisableXSSProtectionOnce

Taking values from other tags

DC-FPX_set() accepts not only fixed text but also the result of another single tag. To do this, replace its tildes with dollar signs.
The name of the parameter can also come from a tag.
A name formed this way cannot be read back the same way. ~DC-SPvar_set($DC-FP$WS-OTP1$$)~ does not work because the nested dollar signs cannot be resolved. The four touched tags further below exist for this purpose.

The suffixes

All suffixes work on the value currently stored in the parameter. What matters is whether a suffix changes the stored value or only outputs it in modified form.
This distinction saves most debugging. ~DC-FP1_touppercase~ outputs nothing but converts the stored value to uppercase. Only the subsequent ~DC-FP1~ displays it. Conversely, ~DC-FP1_base64encoding~ leaves the value untouched and only outputs the encoded version.

Changing the value

_set()

Stores the value. An existing value is replaced.

_reset

Clears the slot. Afterwards, the same parameter can be set again.
_reset is written without brackets. The older notation DC-FPX_reset() can still be found in cross-references in the previous documentation.

_append()

Appends to the existing value. This is the way around the 128-character limit that applies to every WEBSALE tag.
If a tag is longer than 128 characters, the shop no longer processes it but outputs the tag name as plain text. A long list therefore belongs piece by piece in a parameter and from there, as tag-in-tag, in the actual tag.

_replace()

Searches and replaces. Two comma-separated arguments: first the string to search for, then its replacement. If the second argument is empty, the string is deleted.
Special characters that the parser itself uses belong in quotation marks.
The comma separates the two arguments. A comma that is to be searched for or inserted must therefore be in quotation marks; otherwise, the shop reads three arguments and discards the tag.

_slice()

Cuts out a section. Counting starts at 0; the first number is included, the second is not. If the second number is missing, the cut goes to the end.
Both arguments support tag-in-tag.

_truncate()

Truncates after the specified number of characters.

_extractTaggedData()

Cuts out what is between two markers. Both arguments support tag-in-tag.

_convertToEncoding()

Converts the character set. First the source, then the target character set. Useful when data goes to an external system that expects a different character set.

_touppercase and _tolowercase

Convert the stored value to uppercase or lowercase letters. Neither outputs anything itself.

Outputting the value

_length

Outputs the number of characters.

_IndexOf() and _RIndexOf()

Output the position of a string: _IndexOf() that of the first occurrence, _RIndexOf() that of the last. Counting starts at 0; not found results in -1.
Both can also be used as brackets. The positive area appears if the string was found.

Encodings

Seven suffixes output the value in a different encoding without changing it.

_linknameencoding

Outputs the value according to the rules you have defined in the <LinkNameEncoding> section of the shop configuration shop.config for the readable part of your URLs.
Reference: <LinkNameEncoding> section

_encodeISO2HTML

Outputs all characters outside ASCII as decimal HTML entities.

_StripHTML

Outputs the value without HTML markup and without quotation marks. Intended for fields that require plain text, for example a meta description.
The stored value remains unchanged. A later ~DC-FPbeschreibung~ outputs the version with HTML again.

_encrypt() and _hash()

Output the value encrypted or as a checksum so that it can be passed securely to an external system. The stored value remains unchanged. _encrypt() expects two arguments, optionally a third.
_hash() expects three arguments, optionally a fourth.
The content of the parameter is hashed with the secret from the configuration appended. The result is encoded and output.
Without a third parameter, _encrypt() falls back on DCFPXEncryptBlowfishPW from the <Basic> section. This entry is deprecated. Always create new encryptions with a dedicated ID in the <DesignControl> section.
Reference: <DesignControl> section

Checking

_contains()

Applies if the specified string occurs anywhere in the value. Unlike DC-CompareStringInList(), no complete match is required. Case does not matter.
This lets you address a group of categories by their name instead of maintaining category indexes by hand. If a new shirt category is added, the bracket applies without any change to the template.

_verifyChecksum()

Checks the checksum of an invoice or address number from the D&G merchandise management system. The argument is DuG-AdrNr or DuG-ReNr.
Only the check digit is verified, not whether the transaction exists. The tag does not replace a sign-in or an authorization check.
Guide: Displaying order details without sign-in

Passing on names and values

A parameter whose name itself comes from a tag cannot be read directly. For this purpose, there is _touch and the three associated retrieval tags: _touch remembers the name and value of the most recently addressed parameter, and afterwards you retrieve both individually.
Two further tags hold the most recent search result.
The four tags exist separately for both kinds: DC-FP_lastKeyTouched and DC-SP_lastKeyTouched keep their own memory. A _touch on a DC-FP does not change the memory on the DC-SP side.

Limits

When the upper limit for DC-SP parameters is reached, the shop does not create any more. The tag then has no effect, and the log contains a critical error with the number reached. If a selection suddenly disappears on subsequent pages, check the log.

Tags with other prefixes

The tags at a glance

The table applies equally to DC-FPX and DC-SPX. All tags are permitted on all templates.
The previous documentation does not list six suffixes for DC-SP that exist for DC-FP: _jsonencoding, _length, _tolowercase, _touppercase, _urldecoding and _verifyChecksum. In the shop, the same code processes both prefixes, so all suffixes are equally available for DC-SP.
  • Guide: Using free parameters
  • Reference: DC- (counters and calculations)
  • Reference: DC- (loops)
  • Reference: DC- (comparisons and other tags)
  • Basics: Tag basics