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

Rupert Germann rupi at gmx.li
Sun Sep 6 10:35:22 CEST 2009


hi

here's the final patch (v12) including the documentation.

some example settings that I tested:

extTables.php:

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

$TCA['pages']['columns']['storage_pid']['config']['wizards']['suggest'] 
= array(
	'type' => 'suggest',
	'default' => array(
		'searchWholePhrase' => 1,
		'maxPathTitleLength' => 40,
		'searchCondition' => '1=1',
		'maxItemsInResultList' => 5
	),
	'pages' => array(
		'searchCondition' => 'doktype=1',
	),
);


this will add a suggest wizard to pages->storage_pid and to 
tt_content->records (type: insert records)

---
TSConfig:


TCEFORM {
   suggest.default {
     # settings for all suggest wizards in all tables

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

     # (int) expand pidList by this number of levels
     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
   }
   suggest.pages {
     # settings for all suggest wizards from all tables listing records 
from "pages"
   }
   suggest.tt_content {
     # settings for all suggest wizards from all tables listing records 
from "tt_content"
   }

   pages.storage_pid.suggest.default {
     # settings for the suggest wizard for field "storage_pid" in table 
pages

     pidDepth = 1
     cssClass = pages
     searchWholePhrase = 1
     renderFunc = 1
   }
   pages.storage_pid.suggest.default.pages {
     # settings for the suggest wizard for field "storage_pid" in table 
pages listing records from "pages"
   }

   tt_content.records.suggest {
     searchWholePhrase = 1
   }
}


-----------

please test :-)

greets
rupert



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 6872_doc_core_api.txt
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090906/ba1b55c0/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 6872_doc_core_tsconfig.txt
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090906/ba1b55c0/attachment-0001.txt 


More information about the TYPO3-team-core mailing list