[TYPO3-core] RFC: ifEmpty usage

Michael Stucki michael at typo3.org
Fri Sep 23 11:38:59 CEST 2005

Hi there,

please have a look at this page:

The problem is obvious: ifEmpty does not only allow empty strings ("") but
also zeroes (0). This works everywhere except when a "0" is written as a
value somewhere in the content (e.g. in a table cell of a TEXT element).

According to TSref, it is correct that ifEmpty also accepts "0" as an empty
value. However, strictly speaking I'd say that this is wrong according to
the name of the function (empty!=null).

I see three solutions for this:
- Rename ifEmpty to ifFalse and adjust all(!) templates
- Add a new function ifBlank which evaluates using:
    if(!strcmp('', $string)) ...;
- Fix only the part where table cells are trimmed (see bug description)

I'm in favour of adding ifBlank. Any objections?

Regards, michael
Use a newsreader! Check out

More information about the TYPO3-team-core mailing list