[TYPO3-dev] Alter foreign_table_where to select items from parent page

Brian Bendtsen nightowl at galnet.dk
Mon Apr 23 14:04:36 CEST 2007


Hi

I have created a few threads about this problem already, but Im having 
trouble on how to explain the problem. So here goes again.

In my extension I want to make a relation between items in a sysFolder 
and subitems in a sysFolder inside the other folder.

So, when creating a subitem you can select which item from the parent 
folder to attach it to.

Im not sure how to configure this in my TCA.

I have tried opening the database in mysqlFront and executed this sql:

select * FROM tx_ebbolig_afdeling INNER JOIN pages ON 
tx_ebbolig_afdeling.pid = pages.pid WHERE pages.uid = 65;

Where 65 is the uid where my subitems is located. It, as it should, 
returns the items from the parent folder.

I have tried to make the same sql in my TCA like this:

"foreign_table" => "tx_ebbolig_afdeling",	
"foreign_table_where" => "AND pages.uid=###CURRENT_PID### ORDER BY 
tx_ebbolig_afdeling.uid",	

But this doesnt work. I get an empty select box.

Can anybody help?

/Brian Bendtsen




More information about the TYPO3-dev mailing list