Logic Tokens
Logic tokens are a powerful way to include some rudimentary logic within your content.
There are a number of different logic token formats. Each logic token acts upon the value or existence of a content token.
The best way to explain logic tokens is to provide some examples. These examples will all be relative to a token named [MYTOKEN].
- [IFMYTOKEN value="test"][/IFMYTOKEN]
- if [MYTOKEN] exists and the value equals "test" then the content between the tags will be rendered
- [IFNOTMYTOKEN value="test"][/IFNOTMYTOKEN]
- IF [MYTOKEN] exists and the value doesn't equal "test" then the content between the tags will be rendered
Logic Token Examples
Example 1Tags:
[TEST] = "1234"
Content is:
[IFTEST value="1234"]The TEST tag exists and equals [TEST][/IFTEST]
Results in:
The TEST tag exists and equals 1234
Example 2Tags:
[TEST] = "1234"
Content is:
[IFTEST value="6666"]The TEST tag exists and equals [TEST][/IFTEST]
Results in:
No content rendered