[TYPO3] Again about if-staments
Tapio Markula
tapio.markula at dnainternet.net
Sat Jun 17 16:05:48 CEST 2006
JoH wrote:
>>I have something wrong here.
>>
>>temp.colLinks=COA
>>temp.colLinks {
>>
>>10 = TEXT
>>10 {
>>
>>
>>10 = COA
>>10 {
>>stdWrap.if.isTrue.cObject = CONTENT
>>stdWrap.if.isTrue.cObject {
>>table = tt_content
>>select {
>>pidInList = this
>> where = colPos = 9
>>languageField = sys_language_uid
>>}
>>}
>
> This can't be working since you are using "if.isTrue" on a CONTENT element
> without any renderObj.
ok. Sorry, but TSRef is for me hard to read and I don't always figure,
what can do in certain situation. Especially I have difficulties
with everything related with if-statements.
I modified that on the base of this
temp.getRight = CONTENT
temp.getRight < styles.content.getRight
temp.getRight {
stdWrap.ifEmpty.cObject = CONTENT
stdWrap.ifEmpty.cObject {
table = tt_content
select {
pidInList = 690
orderBy = sorting
where = colPos = 2
languageField = sys_language_uid
}
}
}
which renders content
> Since you just want to count entries and not render them you should use
> numRows instead.
> And you can remove pidInList since it's default is "this".
> And you can remove stdWrap since "if" can be used directly in COA.
> if.isTrue.numRows {
> table = tt_content
> select {
> where = colPos = 9
> languageField = sys_language_uid
> }
> }
>
> Should be working
Thank's - worked.
Below working result
temp.colLinks=COA
temp.colLinks {
10 = TEXT
10 {
if.isTrue.numRows {
table = tt_content
select {
where = colPos = 9
languageField = sys_language_uid
}
}
value=<img
src="/fileadmin/template/main/kuvat_takk/{$headerSeeAlso.fileName}"
alt="{$headerSeeAlso.altText}" height="21" width="200">
}
20 <styles.content.getLinks
}
I have used constants because text should be both in Finnish
and in English.
> Joey
>
More information about the TYPO3-english
mailing list