TYPO3 TypoScript 如果相等则隐藏
TYPO3 TypoScript hide if equal
我尝试仅在 end_date 与 start_date 不同时才显示它。使用此代码 end_date 始终隐藏。
temp.title = COA
temp.title {
10 = RECORDS
10 {
source = {GP:tx_myextension_event|event}
source.insertData = 1
tables = tx_myextension_domain_model_event
conf.tx_myextension_domain_model_event = TEXT
conf.tx_myextension_domain_model_event {
if.field = end_date
if.equals.field = start_date
if.negate = 1
}
}
}
如果你想显示 end_date,你需要这个:
temp.title = COA
temp.title {
10 = RECORDS
10 {
source = {GP:tx_myextension_event|event}
source.insertData = 1
# Parse data to integer
source.intval = 1
tables = tx_myextension_domain_model_event
conf.tx_myextension_domain_model_event = TEXT
conf.tx_myextension_domain_model_event {
# You need this to show the end_date
field = end_date
if.equals.field = start_date
if.field = end_date
if.negate = 1
}
}
}
这个有效
temp.title = COA
temp.title {
...
40 = RECORDS
40 {
source = {GP:tx_myextension_event|event}
source.insertData = 1
tables = tx_myextension_domain_model_event
conf.tx_myextension_domain_model_event = TEXT
conf.tx_myextension_domain_model_event {
field = end_date
if.value.field = end_date
if.isLessThan.field = start_date
strftime = %d.%m.%Y
}
stdWrap.noTrimWrap = | - ||
stdWrap.required = 1
}
}
我尝试仅在 end_date 与 start_date 不同时才显示它。使用此代码 end_date 始终隐藏。
temp.title = COA
temp.title {
10 = RECORDS
10 {
source = {GP:tx_myextension_event|event}
source.insertData = 1
tables = tx_myextension_domain_model_event
conf.tx_myextension_domain_model_event = TEXT
conf.tx_myextension_domain_model_event {
if.field = end_date
if.equals.field = start_date
if.negate = 1
}
}
}
如果你想显示 end_date,你需要这个:
temp.title = COA
temp.title {
10 = RECORDS
10 {
source = {GP:tx_myextension_event|event}
source.insertData = 1
# Parse data to integer
source.intval = 1
tables = tx_myextension_domain_model_event
conf.tx_myextension_domain_model_event = TEXT
conf.tx_myextension_domain_model_event {
# You need this to show the end_date
field = end_date
if.equals.field = start_date
if.field = end_date
if.negate = 1
}
}
}
这个有效
temp.title = COA
temp.title {
...
40 = RECORDS
40 {
source = {GP:tx_myextension_event|event}
source.insertData = 1
tables = tx_myextension_domain_model_event
conf.tx_myextension_domain_model_event = TEXT
conf.tx_myextension_domain_model_event {
field = end_date
if.value.field = end_date
if.isLessThan.field = start_date
strftime = %d.%m.%Y
}
stdWrap.noTrimWrap = | - ||
stdWrap.required = 1
}
}