Project

General

Profile

Actions

Feature proposal #2765

closed

IF substitutions support for ELSE

Feature proposal #2765: IF substitutions support for ELSE

Added by krileon over 14 years ago. Updated about 9 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

Updated by beat over 14 years ago Actions #1

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

Updated by krileon over 14 years ago Actions #2

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 about 14 years ago Actions #3

  • Target version set to CB 1.8

Updated by beat almost 14 years ago Actions #4

  • Target version changed from CB 1.8 to CB 2.1

Updated by krileon about 9 years ago Actions #5

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 beat about 9 years ago Actions #6

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

Updated by krileon about 9 years ago Actions #7

  • 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.

Updated by krileon about 9 years ago Actions #8

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom