[TYPO3] Search in Table / tt_address

Gunther Typo3 typo3 at online.de
Fri Aug 10 14:34:08 CEST 2007


Hello,
I like to use the Extension "fesearchintable", but I con not configure it
correctly. I think my knowledge of TScript is not good enough.
I would like to search in the tt_address for "city" and "zip".
I installed the extension, insert one plugin on the PID 35 with the Code
"form" and another plugin on the PID 4 with the Code "results". The
addresses are stored in a sysfolder (PID 61). The form should have two input
fields (City and ZIP) and one search-button.

My TScript Code is:
CONSTANTS:
plugin.tx_fesearchintable_pi1  {
        resultsPID = 4
        CMD = form
        Limit = 10
}
SETUP:
plugin.tx_fesearchintable_pi1 {
        debugRecordFields = 0
        CMD = {$plugin.tx_fesearchintable_pi1.CMD}
        Limit = {$plugin.tx_fesearchintable_pi1.Limit}
        backLink = 0
        backWrap = <div align="center">|</div>

        form = FORM
        form.dataArray {
            #10.label.data =
LLL:EXT:fesearchintable/pi1/locallang.php:label.search
                #10.label.wrap = |:
                10.label = Stadt
                10.type = sword=input,30
                15.label = PLZ
                15.type = sword=input,30
                20.type = submit=submit
                20.value.data =
LLL:EXT:fesearchintable/pi1/locallang.php:label.search
              }

        form.type = {$plugin.tx_fesearchintable_pi1.resultsPID}
        form.locationData = 1
        form.layout =
<tr><td>###LABEL###</td></tr><tr><td>###FIELD###</td></tr>
        form.labelWrap.wrap = <strong>|</strong>
        form.stdWrap.wrap = <table cellspacing="1" cellpadding="1"
border="0">|</table>
        form.wrapFieldName = tx_fesearchintable_pi1[|]

        searchAdditionalPiVarsWrap =  with | as

        searchTables {
                tt_address = 1
                tt_address.name = Adresse
            tt_address.fields = city, zip
            tt_address.pidList = 61  #--> ID des Sysfolders mit den Adressen
                tt_address.recursive = 0
                tt_address.orderBy =
                tt_address.selectAdditionalParams = AND 1=1

            tt_address.listHeader = COA
            tt_address.listHeader {
            10 = TEXT
            10.value = Adresse
                        10.wrap = <h3 style="background-color:#FFCC66;
color:white; padding: 4px">|</h3>
                }

            tt_address.listItem = COA
                tt_address.listItem {
                        stdWrap.wrap = <li>|</li>
                        10 = TEXT
                        10.field = city
                        10.wrap = <strong>Adresse: </strong><strong
style="color:#006699;">|</strong>
            20 = TEXT
            20.field = zip
            #30 = TEXT
            #30.value = more<font size="1">></font>
                        #30.typolink.parameter.data = TSFE:id
                        #30.typolink.wrap = <strong>|</strong>
                        #30.typolink.ATagBeforeWrap = 1
                    #30.typolink.additionalParams.dataWrap =
&tx_fesearchintable_pi1[sTable]=tt_address&tx_fesearchintable_pi1[sUID]={fie
ld:uid}&tx_ttnews[tt_address]={field:uid}
          }
            tt_address.listStdWrap.wrap = <ol style="margin-top:10px">|</ol>

                #tt_address.singleView < plugin.tt_address
                #tt_address.singleView.code >
                #tt_address.singleView.code = SINGLE
              }

        results {
                headerWrap.wrap = <em>|</em>
            displayingWrap.wrap = |
                keywordsWrap.fontTag = <font color="Red">|</font>
                tableListWrap.wrap = <ul>|</ul>
                tableListItemWrap.wrap = <li>|</li>
           }
}

But something works wrong, because the follow things are happen.
1. In the search form, the first label is "search" instead "city".
2. After click on search, the result page (PID 4) open with the search form
instead the results. I think the search did not start correctly. If the
searched address is in the db table I get the search form (PID 4) back and
not the results and when the searched address is not in the db table I get
also the search form (PID 4) back without no answer (ect. the searched zip
is not available).

Please help me, I have to do the search form for my study at the university
and I don't know how I can fix this problem.

Best Regards
Gunther








More information about the TYPO3-english mailing list