I'm trying to write a general use plugin for a calculation fieldtype that evaluates a twig expression (defined in the field settings) to display additional information about the current record in the CP (i.e. price * qty = amount). So far, everything is working perfectly — the generic expression 1 + 1
is evaluated and the result is properly displayed in the field.
The problem is, I don't actually know how to reference the current entry in the CP from within the CP via twig, to get access to the entry field values. Looking for something like {{ entry.price }} * {{ entry.qty }}
, but don't know what to use instead of entry
. Does anyone know a twig expression that I can use?