[TYPO3-core] RFC: MM_foreign_select

René Fritz rene at typo3.org
Fri Mar 3 10:41:10 CET 2006


I wanted to have that in RC but I'm offline till tuesday and I was not able to 
provide a new patch in time before RC.

If someone wants to dig into that, attached are the current XCLASSes from DAM 
providing the functionality the patch provide, but with bugfixes. I do not 
expect that somebody will work on that, but you'll never know.

René


> This is used in the current DAM which uses XCLASSes to enable it.
> It is a main point to use DAM media records as references in a site.
>
> I hope it will find it's way in the official distribution. But I don't mind
> if the solution will look like a little different if it will do the same.
>
> There is a demo extension (bidirectional_example) that do nothing but seems
> to be a basis for discussion for the same topic. Maybe someone else
> implemented similar?
>
>
>
> Problem:
> If I want to use references with an mm table, I can do this
>
> tt_content > tx_dam_mm_ref < tx_dam
>
> The first thing is that I don't know to which field of tt_content this
> reference belongs to. When I have two media fields in tt_content I can't
> seperate them.
> Solution: I introduced a new field in the mm table called 'ident'
>
>
> The second problem is when I use another content table with references too.
>
> tt_content > tx_dam_mm_ref < tx_dam
> tx_mytable > tx_dam_mm_ref < tx_dam
>
> The field tablenames handle this. But only if I select tt_content and
> tx_mytable from a tx_dam tceform element. But that does not make sense.
>
> When I select a tx_dam record from tt_content, "tx_dam" will be written in
> tablenames, but that is a senseless information, I need "tt_content" in it.
> Also uid_foreign and uid_local are switched.
>
> Therefore I need a configuration that work from tt_content but LIKE from
> tx_dam.
>
> A TCA config for my solution looks like this
>
> 'type' => 'group',
> 'internal_type' => 'db',
> 'allowed' => 'tx_dam',
> 'prepend_tname' => 1,
> 'MM' => 'tx_dam_mm_ref',
> 'MM_foreign_select' => 1,
> 'MM_ident' => 'relation_field_or_other_ident',
>
>
> 'MM_foreign_select'  switched uid_foreign and uid_local and set tablenames
> to the local table
>
> 'MM_ident' defines what value should be written to the "ident" field of the
> MM table. This is usually the name of the current field.
>
> A MM table will then look like this
>
> CREATE TABLE tx_cctestmm_local_mm (
>   uid_local int(11) unsigned DEFAULT '0' NOT NULL,
>   uid_foreign int(11) unsigned DEFAULT '0' NOT NULL,
>   tablenames varchar(30) DEFAULT '' NOT NULL,
>   ident varchar(30) DEFAULT '' NOT NULL,
>   sorting int(11) unsigned DEFAULT '0' NOT NULL,
>   KEY uid_local (uid_local),
>   KEY uid_foreign (uid_foreign)
> );
>
>
>
> Attached is a very simple extension with 3 tables and an mm table to test
> this.
>
> This is some month old ... hope it works
>
> --
> COLORCUBE
> digital media lab
>
> www.colorcube.de

-- 
René Fritz
TYPO3 Association - Active Member
http://association.typo3.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: class.ux_t3lib_transferdata.php
Type: application/x-php
Size: 3532 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060303/cd1938f0/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: class.ux_t3lib_tcemain.php
Type: application/x-php
Size: 14557 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060303/cd1938f0/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: class.ux_t3lib_loaddbgroup.php
Type: application/x-php
Size: 8481 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060303/cd1938f0/attachment-0002.bin 


More information about the TYPO3-team-core mailing list