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

Andreas Wolf typo3ml at andreaswolf.info
Tue Jan 8 15:18:32 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

This is an SVN patch request.

Type: New feature

Bugtracker reference:
http://bugs.typo3.org/view.php?id=6872

Branches:
trunk

Problem:
Selecting records from a nested page-structure can be quite difficult,
especially if you search for a record and only know the title.


Solution:
This patch adds new options to TCA to show an input box next to fields
of type "group". While typing in this input box, calls to the server are
triggered and records matching the search-value are returned. Some may
know this feature from Google Suggest.


Configuration:

The extension is configurable via TSconfig on different levels:
 * a global level: TCEMAIN.default.suggest
 * a per-table basis: TCEMAIN.tablename.suggest
   This applies to the table which the record is searched in
 * a per-field basis (for the field the call is triggered from)
   TCEFORM.tablename.field.suggest
   You may also configure each (queried) table differently here:
   TCEFORM.tablename.field.suggest.queriedtable

Available options are:
 * pid
   sets pid(s) to search in, may be a comma-separated list
 * pidDepth
   sets the level up to which to search on subpages of the pids
 * cssClasses
   the classes to apply to the selector
 * suggestClass
   the class to use for rendering the selector. Default ist the shipped
   suggest_default_selector
 * searchWholePhrase
   When set, the comparison is done via LIKE "%searchword%" instead of
   LIKE "searchword%"
 * renderFunc
   The function to use for rendering the record. Not set by default.


Example:

TCEMAIN {
  tx_a21glossary_main.suggest {
    suggestClass = tx_a21glossary_ajaxselect
    pid = 23
  }
  pages.suggest {
    pidDepth = 2
    cssClasses = pages
    searchWholePhrase = 1
  }
  tt_content.suggest {
    searchWholePhrase = 1
  }
  tx_party_parties.suggest {
    suggestClass = tx_party_ajaxselect
  }
}

To be able to fully use this configuration, please install the attached
extension demo_ajaxselect and the extensions party (from xdev SVN) and
a21glossary. demo_ajaxselect contains one table with two fields, both
implementing the selector.



Notes:

The selector is activated via TCA:

"config" => Array (
	"type" => "group",	
	"useSuggest" => true,
	"hideSuggestByDefault" => true,
	"suggestBoxPosition" => 'right'
	[...]
)

"hideSuggestByDefault" may also be overwritten in User-/Group-TSconfig
(options.suggest.hideSuggestByDefault).

I will also try to provide a patch for kickstarter in the next days.


Thanks to all testers, especially Georg Ringer.



Cheers,

Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBR4OGNwJFrtzcYmY6AQgvqQ/6AqxoVpoo6meqGrPp94aEdE+J2DGtctgo
k8BZgaIHmNytsvWeQyo7DY3AsXfTMufm84jsVUV1wnT2Auxpj2iJUGXjoT8k/JiG
7X9oKr2D/fUtUbbAiZ18uSs9MtRf6r2O//tDJv6fPFsIJon3snDOdRBO7PzPrSnn
AUDC0hn0af/Xm9oOfKAsw2XRo15s9Au5S4f0JyPkh7qY+iv1iPYHEQ0S3NceblWa
O1/DxCBq9xBXOw0pvN0OXWnW7DPdzPm9ebwTCr0h6VOoq8vrFHkgiN38w9m8U8Gz
AT55vmR/WWeBCdGsamBGOdEyHH3hi2ijerRxusTuTMj58I/YA7x+w8y1OcFpCWU4
0IqyyqMKzKQa6VIwYn0uVzLXoxEnD2vS9gN1VYJoTiLLAELcAcaOoqv9jWiPfoIw
pcH/1yy/ql9HYE1fZ/sGdld+DKH87slET3SrARuDywe04ssZCMtUuqHN2vUQnwz3
3PZb2mSzSUcbeFLKgq1G73cdea0jofm/LOOLIndSewOXCEBkYOh5xs+ngtV/ZvBg
6Sb+m0iKCvSnAmAIvyxJtMNVWTGIJ5L31GQi8fdzZj60aRzdV0xZOobzHU6eBQPF
gwhxLcrKxPpEM9/IaK9tfe2JZg931gSCivH5+Ai8u0y5JfRjku+oTVosf4MrhVcA
4KuLiLp6ZTU=
=8Zn/
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: T3X_demo_ajaxselect-0_0_0-z-200801081349.t3x
Type: application/octet-stream
Size: 11958 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080108/55204623/attachment-0004.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: group_suggest.gif
Type: image/gif
Size: 97 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080108/55204623/attachment-0001.gif 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: suggest_trunk.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080108/55204623/attachment-0001.txt 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: T3X_demo_ajaxselect-0_0_0-z-200801081349.t3x.sig
Type: application/octet-stream
Size: 536 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080108/55204623/attachment-0005.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: group_suggest.gif.sig
Type: application/octet-stream
Size: 536 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080108/55204623/attachment-0006.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: suggest_trunk.diff.sig
Type: application/octet-stream
Size: 536 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080108/55204623/attachment-0007.obj 


More information about the TYPO3-team-core mailing list