wrap a string in Typo3 only if not empty, and replace with message if empty
this is my typoscript:
nota = TEXT
nota.value = ###WFQBE_FIELD_nota###
nota.stdWrap {
required = 1
wrap = (|)
}
nota.ifEmpty = not available
I want to wrap the field nota in () only if not empty, if empty I want th开发者_C百科e message "not available" to appear.
This works, but the only problem is that the message gets wrapped in () too!!
Any idea? I'm a total newbe in Typoscript..
You can turn your condition around:
nota = TEXT
nota {
value = not available
override {
cObject = TEXT
cObject {
required = 1
value = ###WFQBE_FIELD_nota###
wrap = (|)
}
}
}
If I understood correctly, Your current problem is the "wrap".
As ifEmpty could be stdWrap too, try to override the wrap in ifEmpty condition.
nota = TEXT
nota.value = ###WFQBE_FIELD_nota###
nota.stdWrap {
required = 1
wrap = (|)
}
nota.ifEmpty.wrap = not available|
精彩评论