[Typo3-dev] Filtering by categories in extension
Alexander Langer
alex at big.endian.de
Wed May 19 18:00:32 CEST 2004
Also sprach Sergio Sánchez (sergio at corecanarias.com):
> I have created a new tt_content field for the extension to select
> the category I want to display in the list, but extension manager didn't
> make any code about that so in the list plugin lists all categories. I
> have been lookit at API Doc but I haven't found anything useful for me.
Assuming, the field you extended tt_content with is called
"tx_yourext_category", you can get this value by doing:
$theValue = $this->cObj->data['tx_yourext_category'];
and add $theValue to the MySQL query whereever you want to use it.
(e.g. set $selectConf['where'] to something like 'AND category=$theValue',
if you are using $this->cObj->getQuery() -- see getQuery() docs.
Alex
More information about the TYPO3-dev
mailing list