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

Victor Livakovsky v-tyok at mail.ru
Thu Aug 11 10:20:25 CEST 2011


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 method. 



More information about the TYPO3-english mailing list