[TYPO3-dam] Fetch all items in a category from the DAM Table

Malte Jansen mail at maltejansen.de
Tue Jul 22 21:09:59 CEST 2008


Hi,

there is function in t3lib_db, which generates a where-clause in a 
db-field with a uid-list...

Cheers,

Malte

Dr. Ronald P. Steiner schrieb:
> Hi Benjamin,
> 
> thanks a lot for the hit. It really looks good, and seams to be the 
> right track, but somehow I can't figure it out.
> This code is a most simple, but not working test to use pi_exec_query:
> 
> $res = $this->pi_exec_query('tx_dam',0,' AND sys_language_uid=0');
> while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))    {
>            $items[] = $row;
> }
> debug($items);
> 
> but it does not work. I expected to get all items from the tx_dam table. 
> What am I doing wrong?
> 
> greetings
> 
> Ron
> 
> 
> 
> Benjamin Mack schrieb:
>> Hey Ron,
>>
>> have a look at the function in tslib_pibase:
>> pi_exec_query() (or something like that)
>>
>> There is a variable $mm_cat to get the information of a certain category.
>> The $mm_cat needs "tx_dam_cat" as foreign-table and "tx_dam_mm_cat" as 
>> mm-table. The third parameter in this array can be used to load only 
>> certain categories.
>>
>> Hope this helps a bit.
>>
>> greetings,
>> benni.
>>
>> Dr. Ronald P. Steiner wrote:
>>> Hi Benjamin,
>>>
>>> there is a table "tx_dam_mm_cat". But I can't find any info regarding 
>>> which item belongs to which category.
>>> Isn't there a function to get the items to a category?
>>>
>>> any hints?
>>>
>>> Ron
>>>
>>>
>>> Benjamin Mack schrieb:
>>>> Hey Ronald,
>>>>
>>>> Dr. Ronald P. Steiner wrote:
>>>>> It first seamed to work, but unfortunately in the DB-Table field 
>>>>> tx_dam -> category not the category itself is stored but the 
>>>>> numbers of categories the item is associated with. I could not find 
>>>>> where to get the information which item is in which categories.
>>>> Yes, there is a category table and a category_mm table. These 
>>>> include the needed info about the association with categories.
>>>>
>>>> Is this for the frontend or the backend?
>>


More information about the TYPO3-project-dam mailing list