I am looking for a module or a hook that allow me to use if conditions with tokens.
For example I want to check if a field is equal to a specific value or text
any ideas will be helpful.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
Here is an idea, which I have not tried yet.
Sometimes you have tokens in combination with text formats. E.g. in
commerce_checkout_completion_message_pane_checkout_form() the token replacement happens first, before the text format is applied. I am not sure if I agree with this order, but in this case it gives us some interesting options.
You could define a custom text filter which detects and evaluates markup like this:
and then you can use tokens to insert the true/false.
This still leaves a lot in the open. Most tokens do not produce true/false, so maybe instead you want real equation formulas. But it is a direction you can explore further.
You can try to build it with Rules, but I'm not sure.
Another way is to make you own token module to get it. Token api is one of the easiest api from drupal.