[TYPO3-core] RFC #6872: Add suggest-like feature to TCEforms

Rupert Germann rupi at gmx.li
Sat Sep 5 20:18:31 CEST 2009


hi,

Steffen Kamper schrieb:
> +1 on reading and testing on the latest patch (v11)
> 
> Som remarks that should be fixed later:

should have been fixed yesterday ... ;-)

...

> Documentation is very important, is it already written?

partly (thanks to benni) -> see below

I'm wondering about "TCEMAIN" mentioned in the tsConfig settings. How is 
that supposed to work? function processAjaxRequest() takes only 
"TCEFORM" into account. did I overlook something?



Here's bennis documentation:


=== Documentation (preliminary)

The suggest-feature is implemented as a wizard to TCEforms.

It can be added like any other wizard, basically by modifying the TCA. 
As an example, I will use the "storage_pid" field of the "pages" table.

To get the suggest-feature up and running, please add this to your 
extTables.php.

$TCA['pages']['columns']['storage_pid']['config']['wizards']['suggest'] 
= array('type' => 'suggest');

The suggest field should now show up when editing page properties. When 
typing something in (at least 2-3 characters), there is a list (sorted 
alphabetically) of max. 10 items that can be selected.

The tables that are queried to be shown up are the ones used in 
$TCA['pages']['columns']['storage_pid']['config']['allowed']

The following options are available to be set by TCA, and then 
overridden the following way (the last one takes precedence of the former):

// TCA
1. 
$TCA[$table]["columns"][$field]["config"]["wizards"]["suggest"]["default"]
2. 
$TCA[$table]["columns"][$field]["config"]["wizards"]["suggest"][$queryTable]

// TSconfig:
3. TCEMAIN.default.suggest
4. TCEMAIN.$queryTable.suggest
5. TCEFORM.$table.$field.suggest.default
6. TCEFORM.$table.$field.suggest.$queryTable

For the storage_pid example, this looks like the following (table=pages, 
field=storage_pid, queryTable=pages):

$TCA["pages"]["columns"][$field]["config"]["wizards"]["suggest"]["default"]
$TCA["pages"]["columns"][$field]["config"]["wizards"]["suggest"]["pages"]
TCEMAIN.default.suggest
TCEMAIN.pages.suggest
TCEFORM.pages.storage_pid.suggest.default
TCEFORM.pages.storage_pid.suggest.pages

The following options are avilable:

TCEMAIN.default.suggest {
     # (intList) Limit the search to certain PIDs (and their subpages)
     pidList = 1,2,3,45

     # (int) the number of levels of the subpages of the pidList that 
should be used as well
     pidDepth = 4

     # (int+) max. numbers of characters to display when a path element 
is too long
     maxPathTitleLength = 30

     # (bool) whether to do a LIKE=%mystring% (searchWholePhrase = 1) or 
a LIKE=mystring% (to do a real find as you type), default: 0
     searchWholePhrase = 1

     # additional WHERE clause (no AND needed to prepend)
     searchCondition = doktype=255

     # add a CSS class to every list item, default: ''
     cssClass = myclass

     # PHP class alternative receiver class - the file that holds the 
class needs to be included manually before calling the suggest feature 
(default: t3lib_tceforms_suggest_defaultreceiver), should be derived 
from "t3lib_tceforms_suggest_defaultreceiver"
     receiverClass = tx_myext_receiverclass
}

# This TCA value can only be overriden by TCEFORM. TSconfig not by 
TCEMAIN. TSconfig, as this is only valid for the visibility of the 
suggest field, not for the querying
TCEFORM.$table.$field.suggest.default {
     # (int) Minimum number of characters needed when the AJAX call 
starts to run
     minimumCharacters = 2
     # (bool) Hide the suggest field
     hide =  0/1
}

=======



greets
rupert


More information about the TYPO3-team-core mailing list