Project

General

Profile

Actions

Feature proposal #2765

closed

IF substitutions support for ELSE

Added by krileon about 13 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
15 September 2011
Due date:
% Done:

100%

Estimated time:

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

Actions #1

Updated by beat about 13 years ago

The proposed markup is not "validating" as there is no closing tag for the else tag....

Actions #2

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.

Actions #3

Updated by beat about 13 years ago

  • Target version set to CB 1.8
Actions #4

Updated by beat almost 13 years ago

  • Target version changed from CB 1.8 to CB 2.1
Actions #5

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]

Actions #6

Updated by beat about 8 years ago

Yup, the latest else-syntax looks good :-)

Actions #7

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.

Actions #8

Updated by krileon almost 8 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF