[TYPO3] problem with the CONTENT object and the .if stdWrap property

Peter Klein peter at umloud.dk
Tue Jun 17 20:53:00 CEST 2008


Hi Cohn.

Try changing:

    10.value < temp.getRandomImage

Into:

    10.value.cObject < temp.getRandomImage

--
Peter Klein

"John Kavanagh" <john.kavanagh at roomthree.com> wrote in message 
news:mailman.7664.1213635273.4573.typo3-english at lists.netfielders.de...
Hello,



I am having a problem with the CONTENT object and the .if stdWrap
property....



My Typoscript queries a table in the database and if a value is returned
it displays a specified image and if none appears, it shows another.



temp.randomBannerImage = COA_INT

temp.randomBannerImage {

    10 = TEXT

    10.value < banner_image01.jpg

    10.if.isFalse.numRows < temp.databaseQuery

    20 = TEXT

    20.value = banner_image02.jpg

    20.if.isTrue.numRows < temp.databaseQuery

}



This works okay, but when I changed the 1st image to be a random image
taken from a specified folder I ran into problems!!



temp.getRandomImage = CONTENT

temp.getRandomImage {

    table = tt_content

    field = images

    select {

        pidInList = 58

        max = 1

        orderBy = rand()

    }

    renderObj=COA

    renderObj {

        10=TEXT

        10 {

            wrap=|

            field=image

        }

    }

}



temp.randomBannerImage = COA_INT

temp.randomBannerImage {

    10 = TEXT

    10.value < temp.getRandomImage

    10.if.isFalse.numRows < temp.databaseQuery

    20 = TEXT

    20.value = banner_image02.jpg

    20.if.isTrue.numRows < temp.databaseQuery

}





For some reason both image names appear - it seems the CONTENT item
temp.getRandomImage is igonoring the .if.isFalse statement!!

Can anyone explain why or offer a workaround??



Thanks a million!!

John.















The random image always comes out, ignoring the if.isFalse statement.




More information about the TYPO3-english mailing list