我想要做的事情非常复杂,并且涉及到Extbase扩展......
一步一步,我正在尝试做什么:
以下是我正在使用的typoscript代码:
// load information, if pages lack info, into register
10 = LOAD_REGISTER
10 {
lacksAnfahrt {
cObject = USER_INT
cObject {
userFunc = tx_extbase_core_bootstrap->run
pluginName = Pa_klinik_data_edit
extensionName = Hplusinfo
controller = SpitalInfoPA
switchableControllerActions {
SpitalInfoPA {
1 = completeAnfahrt
}
}
}
}
lacksAktivitaeten < .lacksAnfahrt
lacksAktivitaeten.cObject.switchableControllerActions.SpitalInfoPA.1 = completeAktivitaeten
lacksBildergalerie < .lacksAnfahrt
lacksBildergalerie.cObject.switchableControllerActions.SpitalInfoPA.1 = completeBildergalerie
// build a list of PIDs that are going to be marked in navigation
lackPIDs.cObject = COA
lackPIDs.cObject {
10 = TEXT
10 {
value = {$config.PIDLists.anfahrt},
if {
value = 1
equals.data = register:lacksAnfahrt
}
}
20 < .10
20.value = {$config.PIDLists.bildergalerie},
20.if.equals.data = register:lacksBildergalerie
30 < .10
30.value = {$config.PIDLists.aktivitaeten},
30.if.equals.data = register:lacksAktivitaeten
// don't let the comma separated list end with a comma
99 = TEXT
99.value = 0
} // lackPIDs
} // REGISTER
// mark incomplete pages with a red exclamation mark
20 { // = HMENU
1 { // = TMENU
NO { // = 1
stdWrap.wrap = |<span class="warning lacksInfo">!</span>
stdWrap.wrap.if {
value.data = register:lackPIDs
isInList.field = uid
}
}
}
}
如果我打印出register:lacksBildergalerie
和所有其他人,他们的值是正确的(0或1)。
但是lackPIDs
列表总是为空(除了最后的0)...中间部分一定有问题:
10 {
value = {$nav.PIDLists.anfahrt},
if {
value = 1
equals.data = register:lacksAnfahrt
}
}
此评估无论如何都会返回 false 。
我也试过了不同的 if 函数,如:
10 {
value = {$nav.PIDLists.anfahrt},
if {
isTrue.data = register:lacksAnfahrt
}
}
但这并没有解决问题。
答案 0 :(得分:0)
忽略了其他寄存器也在使用USER_INT