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

JoH asenau info at cybercraft.de
Mon Apr 23 23:42:56 CEST 2007


>>>> Could you please explain the structure.
>>>> What I understood is this:
>>>>
>>>> Sysfolder 1
>>>>     Item 1
>>>>     Item 2
>>>>     Sysfolder A
>>>>         Item A
>>>>         Item B
>>>>
>>>> And you want a relation between
>>>> Item 1 <=> Item A
>>>> Item 2 <=> Item A
>>>> Item 1 <=> Item B
>>>> Item 2 <=> Item B
>>>>
>>>> Something like that?
>>>>
>>> Yes, that is what I mean.
>>
>> Next Question:
>> Where "are" you during the SELECT statement?
>> Or in other words: Do you want to select for Item A and get Item 1
>> or 2 or do you want to select for Item 1 and get Item A or B as
>> related elements?
>>
>> ###CURRENT_PID### for Item A and B will be the UID of Sysfolder A
>> ###CURRENT_PID### for Item 1 and 2 will be the UID of Sysfolder 1
>>
> I want to select for item A and get Item 1 or 2

Then this won't work:

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

pages.uid = ###CURRENT_PID### will return Sysfolder A and not Sysfolder 1
because the PID points to the parent page of the item itself and not the
sysfolder containing it.
Therefor I guess pages.uid = 65 will return a correct result, because 65 is
the uid of Sysfolder 1. But this is not equal to ###CURRENT_PID###.
It seems in this case you might get better results by using a real MM
relation with an additional table.

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com






More information about the TYPO3-dev mailing list