'If ``condition`` is nonempty and nonzero, emit ``trueval``;
otherwise, emit ``falseval`` (if provided).'

@staticmethod
def tmpl_if(condition, trueval, falseval=u''):

    try:
        int_condition = _int_arg(condition)
    except ValueError:
        if (condition.lower() == 'false'):
            return falseval
    else:
        condition = int_condition
    if condition:
        return trueval
    else:
        return falseval
