[TYPO3] serach box with multiple language

Ronald Steiner Ronald.Steiner at googlemail.com
Tue Sep 16 21:07:21 CEST 2008


Hi,

maybe you want to try this TS-only solution (see below).

greetings

Ron

P.S.: TS-Only solution:

subpart_searchBox = COA
subpart_searchBox {
   stdWrap.prefixComment = 2 | subpart_searchBox
   wrap = |</form>
   10 = TEXT
   10 {
      typolink.parameter = {$subpart_searchBox.searchUID}
      typolink.returnLast = url
      typolink.useCacheHash = 1
      typolink.no_cache = 0
      wrap = <form action="|" method="post" id="searchform">
   }
   20 = COA
   20 {
     wrap = <p>|</p>
     10 = TEXT
     10.value = <label for="searchfield">search: </label>
     20 = TEXT
     20 {
       data = GPvar : tx_indexedsearch |sword
       wrap = <input name="tx_indexedsearch[sword]" value="|" 
class="field" type="text" id="searchfield" />
     }
     30 = COA
     30 {
       10 = TEXT
       10.value = <input type="hidden" name="tx_indexedsearch[sections]" 
value="0" />
       20 = TEXT
       20.value = <input type="hidden" name="tx_indexedsearch[pointer]" 
value="0" />
       30 = TEXT
       30.value = <input type="hidden" name="tx_indexedsearch[ext]" 
value="0" />
       40 = TEXT
       40.data = GPvar:L
       40.wrap = <input type="hidden" name="tx_indexedsearch[lang]" 
value="|" />
       50 = TEXT
       50.value = <input name="tx_indexedsearch[submit_button]" 
value="Search" type="hidden" />
       60 = TEXT
       60.value = <input type="image" class="searchsubmit" 
src="fileadmin/templates/icon/search.gif" />
     }
   }
   30 = COA
   30 {
     #if.isTrue = {$subpart_searchBox.showAdvanced}
     wrap = <p>|</p>
     10 = TEXT
     10 {
        value = Advanced search »
        typolink.parameter = {$subpart_searchBox.searchUID}
        typolink.additionalParams = &tx_indexedsearch[ext]=1
        typolink.useCacheHash = 1
        typolink.no_cache = 0
     }
   }
}

[globalVar = GP:L =]
subpart_searchBox.20.10.value = <label for="searchfield">Suche: </label>
subpart_searchBox.30.10.value = Erweiterte Suche »
[global]


rupali.ffm at googlemail.com schrieb:
> Hello list,
> i need to show "search" as default text for english language and "suche" as
> default text for german language in macina_search box, following is the
> template i used, but i dont know how to change the dafault value to search
> in case of english language. pls help..
> 
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> 
> <html xmlns="http://www.w3.org/1999/xhtml">
> 
> <head>
> 
> <title>Template file for the&quot;macina_searchbox&quot;extension.</title>
> 
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
> />
> 
> <script>
> 
> </head>
> 
> <body>
> 
> <h3>Template file for the &quot;macina_searchbox&quot; extension.</h3>
> 
> <p><b>Available Markers:</b></p>
> 
> <ul>
> 
>   <li>###HEADLINE### Displays the Headline</li>
> 
>   <li>###ADVANCED### Advanced Search Link</li>
> 
>   <li>###SUBMIT### Alttext for the submit button</li>
> 
>   <li>###ACTLANG### UID of the actual language</li>
> 
>   <li>###SEARCHPID### PID of the Searchpage</li>
> 
> </ul>
> 
> <!-- ###TEMPLATE### begin -->
> 
> <form action="###SEARCHPID###" method="post" name="searchform"
> id="searchform" style="margin:0px; padding-top:10px; ">
> 
>                 <input name="tx_indexedsearch[sword]" type="text" value
> ="Suche" id="searchbox" onfocus="this.value = (this.value=='Suche')? '' :
> this.value;" style="height:12px; width:150px; font-size:9px;
> background:#cccccc;padding-left:3px;border:1px solid #e6e8e9;
> color:#666666;padding-bottom:1px;" />
> 
>                 <input class = "go" name="tx_indexedsearch[submit_button]"
> type="submit" style ="height:17px; width:17px;" value="" />
> 
>                 <input type="hidden" name="tx_indexedsearch[_sections]"
> value="0" />
> 
>                 <input type="hidden" name="tx_indexedsearch[pointer]"
> value="0" />
> 
>                 <input type="hidden" name="tx_indexedsearch[ext]" value="0"
> />
> 
>                 <input type="hidden" name="tx_indexedsearch[lang]"
> value="###ACTLANG###" />
> 
> 
> 
> </form>
> 
> <!-- ###TEMPLATE### end -->
> 
> </body>
> 
> </html>
> 
> 
> 
> TS is as follows:
> 
> page.config.index_enable = 1
> 
> lib.suche < plugin.tx_macinasearchbox_pi1
> lib.suche{
>  pidSearchpage = 81
>  templateFile = fileadmin/templates/searchbox.tmpl
> }


More information about the TYPO3-english mailing list