


Suppose you want to insert a searchbox on all pages, but don't want to install additional extensions like "macina_searchbox", you can do it all by TS. :)
First create a page, and insert the indexed search plugin on that page, and make sure the search are working..
Then insert the code below in your TS setup, and change the value of the constant "plugin.tx_indexedsearch.searchUID" to be the pageID of the page you just created.
Setting the "plugin.tx_indexedsearch.showAdvanced=1" will also display a link below the searchbox, which points to the Advanced searchform.
Place this in CONSTANTS:
plugin.tx_indexedsearch.searchUID = 82 plugin.tx_indexedsearch.showAdvanced = 0
Place this in SETUP:
# --- SEARCHBOX OBJECT ---------------------------------- lib.searchbox = COA_INT lib.searchbox { stdWrap.prefixComment = 2 | lib.searchbox 10 = TEXT 10.typolink.parameter = {$plugin.tx_indexedsearch.searchUID} 10.typolink.returnLast = url 10.wrap = <div id="indexedsearchbox"><form action="|" method="post" id="indexedsearch"><table cellpadding="0" cellspacing="0" border="0"> 20 = COA 20 { wrap = <tr> | </tr> 10 = TEXT 10.data = GPvar : tx_indexedsearch |sword 10.wrap = <td><input name="tx_indexedsearch[sword]" value="|" class="searchbox-sword" type="text" /></td> 20 = COA 20 { wrap = <td align="right"> |</td> 10 = TEXT 10.value = <input type="hidden" name="tx_indexedsearch[sections]" value="0" /> 20 = TEXT 20.value = <input name="tx_indexedsearch[submit_button]" value="Search" type="hidden" /> 30 = TEXT 30.value = <input name="search" src="fileadmin/templates/images/search.gif" value="Search" class="searchbox-button" type="image" /> } } 30 = COA 30 { wrap = <tr>|</tr> 10 = TEXT 10.value = Advanced search » 10.typolink.parameter = {$plugin.tx_indexedsearch.searchUID} 10.typolink.additionalParams = &tx_indexedsearch[ext]=1 10.wrap = <td align="right" colspan="2">|</td> if.isTrue = {$plugin.tx_indexedsearch.showAdvanced} } wrap = | </table></form></div> }
This snippet was submited by Peter Klein.


Comments (3)