Project

General

Profile

Actions

Feature proposal #4514

closed

Extend substitution usage with further processing features

Feature proposal #4514: Extend substitution usage with further processing features

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

Status:
Rejected
Priority:
Normal
Assignee:
Target version:
-
Start date:
06 June 2014
Due date:
% Done:

100%

Estimated time:

Description

Currently you can do IF statements or substitute in values, but it's commonly requested to do simple php behaviors or simple math like adding two values together. Would be neat to have something like the following.

[cb:math method="add"][cb_points][cb_rating][/cb:math]

That would for example add the two fields together. Date substitution could be upgraded to support supplying a field so the date being formatted isn't always now. Inline substitutions could also be helpful. For example you supply a math or if substitution inside of a date substitution.

Updated by beat over 12 years ago Actions #1

We should definitely discuss the syntax there.

We need something humanly readable and natural.

e.g. instead of:
[cb:math method="add"][cb_points][cb_rating][/cb:math]

we could have:
[cb:formula][cb_points]+[cb_rating][/cb:formula]

or something even easier to read:
[cb_points]+[cb_rating]

The "IF" logical maths implementation could be a nice base.

Updated by krileon almost 10 years ago Actions #2

I agree with [cb:formula][cb_points]+[cb_rating][/cb:formula] as that's most familiar to our current usages. CB Auto Actions already has parsing code for this as well so it's absolutely doable.

Updated by krileon almost 10 years ago Actions #3

  • Target version changed from CB 2.1 to CB 3.0

This can be provided by CB Auto Actions now via the trigger. Can be added as core functionality with CB 3.0 once the substitutions API has been further rewritten.

Updated by krileon 3 months ago Actions #4

  • Status changed from Assigned to Rejected
  • Target version deleted (CB 3.0)
  • % Done changed from 0 to 100

Available via CB Auto Actions. CB Replacer Bot can also be used to add custom shortcodes.

Actions

Also available in: PDF Atom