[TYPO3-english] Re : Function to get content of a page (to be used inuserFunc)

joel zimmerli baden32 at yahoo.fr
Thu Aug 11 16:31:06 CEST 2011

Hi Victor,
Thank you for your reply and tips. Maybe I'm doing something wrong but the TS 
code you gave does not return the element in the right order.
If I take your exeample, I would expect to get bloc contents of page 3, then 
contents of page 87 and finally 24.

Of course block for each page should be returned in the order defined on each 

I tried to add sorting=pid,sorting but in this case, the order of the page (3, 
87, 24) is not respected...

By the way, the page id to extract content should be transmitted to my "extract" 
page using a webform. How it is possible to build the pidInList = accoring to 
the POST info?

Thanks in advance for your help.

De : Victor Livakovsky <v-tyok at mail.ru>
À : typo3-english at lists.typo3.org
Envoyé le : Jeu 11 août 2011, 10h 20min 25s
Objet : Re: [TYPO3-english] Function to get content of a page (to be used 

Hi, Joel.

Surely, you can do it with TS:
lib.all_content = CONTENT
lib.all_content {
table = tt_content
select {
   pidInList = 3,87,24
   where = (colPos=0)
   orderBy = sorting

At 'pidInList ' you can provide your comma-separated list of page ids.

If you want to do it with userFunc, also not a big deal - done with simple SQL:
SELECT * FROM 'tt_content' WHERE pid IN (3,87,24) AND NOT hidden AND NOT deleted
Surely, you should do it with $GLOBALS['TYPO3_DB'] methods, which you can find 
at class t3lib_DB
Or you can do it with 'cObjGetSingle' method of class tslib_cObj, and then TYPO3 
will do everything by itself - you'll just need to provide TS code above to this 

TYPO3-english mailing list
TYPO3-english at lists.typo3.org

More information about the TYPO3-english mailing list