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

Peter Klein peter at umloud.dk
Tue Apr 24 10:50:47 CEST 2007


Hi Brian.
Your example on what you do in mysqlFront and in TYPO3 is quite different. 
Have you tried something like this (Untested):

"foreign_table" => "tx_ebbolig_afdeling INNER JOIN pages ON 
tx_ebbolig_afdeling.pid = pages.pid",
"foreign_table_where" => "AND pages.uid=###CURRENT_PID###",

-- 
Peter Klein/Umloud Untd


"Brian Bendtsen" <nightowl at galnet.dk> skrev i en meddelelse 
news:mailman.1.1177329885.17171.typo3-dev at lists.netfielders.de...
> 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