[Typo3-dev] Extended Search: pi_list_query() and pi_list_searchBox()
Daniel Pötzinger
operation-lan at gmx.de
Mon Mar 22 20:19:55 CET 2004
I have extend the pi_base with two new functions which extend
pi_list_query() and pi_list_searchBox().
It extends the behavior of the standard search formular, which is
normaly used for own Extensions to search in the browselist. So you can
configure an complex Searchformular with Typoscript.
I thought to make it public if anyone has a need for it? But it is not
useful to implement it as an extension I think, perhaps someone could
extend pi_base?
(Or you have a better idea to make it public)
Here is the short description of what the extSearch do:
The Idea is that every Plugin could contain TS parameters *.extSearch
(simylar to *.listView)
To use extSearch in your Extension
You just have to include these lines:
//Pass Variables for extended Search:
$this->internal['extSearch']=$conf['extSearch.'];
The Configuration of this Funtion is done by Typo Script:
.extSearch.use=1 //Must be 1 to activate the extSearch Functions
You can define different fields which are shown in the search form by
adding a .number:
.extSearch.1 {
type --- can be "text","select","radio"
value --- only for type "select" and "radio", here you have to specify
the values for search
(Feature: if type is select you can use #no# for an entry like
"--all--")
valname --- only for type "select" and "radio", it is optional here
you can specify the name to show for the values
if not set value is used. !! The function tries to translate
these names with the extensions localconf.php
tabkey --- must be specified: here you can insert the table colums. It
is used for generating the query. You can specify more than one with comma
special --- can be "selectable" - a checkbox is insert under the
field, only if the user check this box the field is included at the search
"andorselect" - the user can specifie how this field
should be linked with the others ("AND" or "OR")
where -- Can be "and" or "or". Optional you can specify how this field
should be linked with the others in the query
}
Example Configuration for newloginbox_pi3:
plugin.tx_newloginbox_pi3.extSearch.use = 1
plugin.tx_newloginbox_pi3.extSearch.1 {
type=text
tabkey=username
name= User
special=selectable
}
plugin.tx_newloginbox_pi3.extSearch.2 {
type=text
tabkey=email
name= E-Mail
special=andorselect
}
plugin.tx_newloginbox_pi3.extSearch.3 {
type=select
tabkey=country
value=#no#,dk,de,uk,fr
valname=-dont care-,Dänmark,Deutschland,United Kingdom,France
name= Country }
plugin.tx_newloginbox_pi3.extSearch.4 {
type=radio
tabkey=city
name= City
value=chemnitz,new york
}
The result is an Search formular with these four fields.
The changes in pi_base are: Two new functions pi_list_extsearchBox
which is called instead of pi_list_searchBox if extSearch.use=1 is.
And pi_list_extquery() which is called from inside pi_list_query() and
generates the searchWhere (with help of $this->cObj->searchWhere) .
//The Searchbox can be styled with CSS
-Daniel Pötzinger
More information about the TYPO3-dev
mailing list