Feature proposal #2765
closedIF substitutions support for ELSE
Description
Would be neat for IF substitutions to be able to support an ELSE case as follows.
[cb:if cb_username!="Admin"]Hello Guest[cb:else]Hello Admin[/cb:if]
https://www.joomlapolis.com/forum/154-advanced-members-support/176226-cb-if-on-select-field
Updated by beat about 13 years ago
The proposed markup is not "validating" as there is no closing tag for the else tag....
Updated by krileon about 13 years ago
Just a suggestion, it doesn't have to be exactly that. Just something for the REGEX to match against for the ELSE.
Updated by beat almost 13 years ago
- Target version changed from CB 1.8 to CB 2.1
Updated by krileon about 8 years ago
Example ELSE usage (syntax to be tested and implemented):
[cb:if usergroup includes "2"]I have Registered Usergroup[cb:else]I do not have Registered Usergroup[/cb:else][/cb:if]
Updated by krileon about 8 years ago
- Status changed from New to Resolved
- Assignee set to krileon
- % Done changed from 0 to 100
Implemented in MR !1121
This implements else and elseif usages. Example of usage as follows in proposed MR.
[cb:if usergroup includes "2"]I am Registered.[cb:elseif usergroup includes "8"]I am Public.[/cb:elseif][cb:elseif usergroup includes "1"]I am Super User.[/cb:elseif][cb:else]I am not Registered.[/cb:else][/cb:if]
In short structure it similar to a PHP usage.