[TYPO3-english] Random content via TypoScript

Arno Dudek webmaster at adgrafik.at
Wed Aug 22 15:26:34 CEST 2012


lib.topimage = COA_INT
lib.topimage {
     10 = CONTENT
     10 {
         table = tt_content
         select {
             pidInList = 51
             max = 1
             orderBy = RAND()
             # @see 
http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.6.0/view/1/5/#id1507420
             languageField = sys_language_uid
         }
         # to debug:
         renderObj = TEXT
         renderObj.field = uid
     }
}

You can also see the id of the CE in the source. Every CE gets an ID 
like "c45".

lg arno


Am 22.08.12 09:28, schrieb Thomas Lunde:
> Hi
>
> I have written the following TS code for showing random content:
>
> lib.topimage = COA_INT
> lib.topimage {
> 10 = CONTENT
> 10 {
> table = tt_content
> select {
> pidInList = 51
> max = 1
> orderBy = RAND()
> }
> }
> }
>
> But I have two issues.
>
> 1) Is it possible to print to the screen which ID is shown? This is for
> debug.
>
> 2) My site is in two languages, but it seems that this code doesn't care
> about the language. How can I make the code check the language to?
>
> Thanks! :)
>
> /Thomas



More information about the TYPO3-english mailing list