[TYPO3-dev] select field with data from ext_tables_static+adt.sql

Thomas Mammitzsch typo at pure.kicks-ass.net
Tue Sep 16 16:20:05 CEST 2008


hi Artis,

works! Thanks!

bye, Thomas


Artis Lismanis schrieb:
> Hi Thomas
> 
> I was just battling with a similar problem and found my answer in 
> static_info_tables extension. In order for you to be able to access 
> static information stored in the root page (PID 0) your tables have to 
> be defined as tables allowed at root level. Below is an example from 
> ext_tables.php found in static_info_tables extension; the setting you 
> are looking for is 'rootLevel' => 1
> 
> Hope this helps.
> 
> Artis
> 
> 
> 
> $TCA['static_territories'] = array(
>     'ctrl' => array(
>         'label' => 'tr_name_en',
>         'label_alt' => 'tr_name_en,tr_iso_nr',
>         'readOnly' => 1,    // This should always be true, as it 
> prevents the static data from being altered
>         'adminOnly' => 1,
>         'rootLevel' => 1,
>         'is_static' => 1,
>         'default_sortby' => 'ORDER BY tr_name_en',
>         'title' => 
> 'LLL:EXT:'.STATIC_INFO_TABLES_EXTkey.'/locallang_db.xml:static_territories.title', 
> 
>         'dynamicConfigFile' => PATH_BE_staticinfotables.'tca.php',
>         'iconfile' => 
> PATH_BE_staticinfotables_rel.'icon_static_territories.gif',
>     ),
>     'interface' => array(
>         'showRecordFieldList' => 'tr_name_en,tr_iso_nr'
>     )
> );
> 
> 
> 
> Thomas Mammitzsch wrote:
>> Hi list,
>>
>> how can i use static data from pid 0 (siteroot, because its the only 
>> page i know that must exist) in my TCE-Forms (e.g. a Selectfield from 
>> foreign table)? Unfortunately it seems like the pid of the static data 
>> must exist as uid in the pages table (which is not, theres no uid 0).
>>
>> The Backend tries to select the static entries for my selectfield like 
>> that:
>>
>> SELECT 
>> user_static_cat.uid,user_static_cat.title,user_static_cat.hidden,user_static_cat.starttime,user_static_cat.endtime 
>>
>>             FROM user_static_cat, pages
>>             WHERE
>>                 pages.uid=user_static_cat.pid
>>                                 AND pages.deleted=0  AND 
>> user_vptarticle_cat.deleted=0 AND  1=1  
>>
>> which of course results in no result. :(
>>
>> The only workaround i found is to move the static data to another 
>> page, after import to db(e.g. a sysfolder)
>>
>> any ideas?
>>
>> regards, Thomas




More information about the TYPO3-dev mailing list