Documentation if and with issues

Please share a repository that reproduces the behavior you mentioned.

You are quoting examples from the Documentation.
These examples have been reviewed by several people and they do work.

We need to see the context of your project to understand why the if and if else conditionals do not apply in your setup.

Also please have a look at the Requesting Help guidelines for reference.