I started now to add the Typo3 indexed search to some of my websites.
But how to add a searchbox on top of the website? There are several extensions for this, but some simple TypoScript is sufficiant. The following code in my template generates such a box (see on top of this page). The style is done of course by CSS.
temp.searchbox >
temp.searchbox = COA
temp.searchbox {
20 = TEXT
# pid of page including index_search plugin
20.typolink.parameter = 46
20.typolink.returnLast = url
20.wrap = <form action="|" method="post"><span>
30 = TEXT
30.value = <input name="tx_indexedsearch[sword]" value="Search item..." \
type="text" title="Search the homepage." onfocus="javascript:this.value=''" />
40 = TEXT
40.value = <input name="submit" value="Search" type="submit" class="submit" />
50 = TEXT
50.value = </span></form>
wrap = <div class="absearchbox">|</div>
}
page.10.subparts.SEARCHBOX < temp.searchbox
On a multilanguage site like www.weltcafe-dresden.de you can add a simple language switch like the following for German (L=0, Default) and English (L=1):
[globalVar = GP:L = 1]
temp.searchbox {
30.value = <input name="tx_indexedsearch[sword]" value="Search item..." \
type="text" title="Search the weltcafe-dresden homepage." onfocus="javascript:this.value=''" />
40.value = <input name="submit" value="Search" type="submit" class="submit" />
}
[else]
temp.searchbox {
30.value = <input name="tx_indexedsearch[sword]" value="Suchbegriff..." \
type="text" title="Durchsuchen Sie die weltcafe-dresden Seite." onfocus="javascript:this.value=''" />
40.value = <input name="submit" value="Suchen" type="submit" class="submit" />
}
[end]
Your comment