I use a condition with != to show or hide a div with content in it based on the field is emtpy or not.
The problem: If the field value is zero the condition also becomes true.
Since zero does not automatically mean empty, this will be a bug in the worst case.
The ACF field is a textfield which also means that normaly shouldn’t happen.
The version here is still 1.9.7 (Jenn had made changes to this instance in the Brickscore which I don’t think have yet reached the final version).
Do you mean this ACF field might consist only “0”? And sometimes it could be some other text like “hello” or totally empty.
Can we have some use cases so we can discuss how to handle this?
Of course for the time being, strlen with {echo:} could be the easiest solution.
The field that is proved for the condition can contain a number from 0 to 100. It’s a textfield.
One condition proves simply is field not empty (!=)-> show the div. Why ever if the fieldvalue is 0 the zero gets interpreted as empty (whats not true, especially not for a textfield) and the div with the parts are hidden.
My usecase is (you know the project ) on testsiegertarife.de the insurance feature cards. If a acf field doesn’t contain a value the rating bar with value etc. should be hidden.
You do you my friend, but there’s a reason testing for empty strings is done with !=“” and not !=
If you want to tell the PHP devs to do it differently, I wish you luck: