Project

General

Profile

Actions

Feature proposal #7980

open

Implement IF substitution support for outputting parent conditions content

Added by krileon over 4 years ago. Updated 3 months ago.

Status:
Assigned
Priority:
Low
Assignee:
Target version:
Start date:
04 May 2020
Due date:
% Done:

0%

Estimated time:

Description

If you try to use ELSEIF as a means of having alternative conditions for an IF substitution you have to duplicate your content. This isn't ideal and is a bit of a waste of storage space and management for it is frustrating. Review implementing support for inheriting a parent conditions content. Example of this as follows.

[cb:if PARAMETER="REPLACEMENT" and PARAMETER="REPLACEMENT"]CONTENT[cb:elseif PARAMETER="REPLACEMENT" and PARAMETER="REPLACEMENT"]DUPLICATE_CONTENT[/cb:elseif][cb:else]DIFFERENT_CONTENT[/cb:else][/cb:if]

If I want my IF and ELSEIF to output the same content I have to duplicate it. There should be a means of passing the parent content to the child condition so the child condition can output it if desired. Something like the below for example.

[cb:if PARAMETER="REPLACEMENT" and PARAMETER="REPLACEMENT"]CONTENT[cb:elseif PARAMETER="REPLACEMENT" and PARAMETER="REPLACEMENT"][parent_content][/cb:elseif][cb:else]DIFFERENT_CONTENT[/cb:else][/cb:if]

Substitution would probably need to be more strict to avoid conflicts with other substitutions like it, but the idea would be you don't need to duplicate content for OR cases. This really is only a problem if you have an OR condition that you want to also combine with an AND.

https://www.joomlapolis.com/forum/153-professional-member-support/242459-mix-or-and-and-in-a-cb-substitution#318249

Actions

Also available in: Atom PDF