[Typo3-dev] ext dev question: category to display?
Wolfgang Klinger
wolfgang at stufenlos.net
Tue Jun 29 18:25:38 CEST 2004
*hiya!*
On Tue, 29 Jun 2004, Daniel Pötzinger wrote the following:
> I think the rest is php... Read out the configured categorys to display and
> then make your database select statment just in the way you posted above..
> (Syntax: categoryb IN ('1','2')) Or what do you mean?
Sounds more like a MM relation problem.
person
person_category_mm
category
One person can have many categories and a category can be assigned to
many persons.
You can solve this either with mm tables (as outlined above) or you may
(if you've chosen to use a comma separated list) use FIND_IN_SET while
iterating over one list split by ',', though that's an ugly solution...
(don't even think about it *hehe*) ;-)
So make sure you've selected "real mm relations" in the kickstarter!!
For the plugin you may chose the comma separated list, no problem here,
as you can easily construct a query like:
"WHERE category.uid IN ('".$this->cObj->data['tx_my_ext_cats']."')"...
(check if tx_my_ext_cats is not empty before
but... that's another story... ;-))
Check out the mm methods in t3lib_db...
bye
Wolfgang
--------------------------------------------------------
Wolfgang Klinger mailto:wolfgang at stufenlos.net
Public Key:
http://www.stufenlos.net/wolfgang/stfl_wolfgang.gpg
--------------------------------------------------------
More information about the TYPO3-dev
mailing list