+ Reply to Thread
Results 1 to 10 of 10

Thread: Show text inside search box.

  1. #1

    Show text inside search box.

    Hello. How can we have a text inside search box -like "Search the website or Search after Part Number- in multilanguage", that will go when you click and start typing? Quick search box is quite simple and that is a mean to make it easy to spot by visitors. Thanks

  2. #2
    Flynax developer
    Join Date
    Jun 2010
    Posts
    239
    Hello,

    You can try to make it the following way:

    Code:
    Only registered members can view the code.

  3. #3
    Quote Originally Posted by Vladimir View Post
    Hello,

    You can try to make it the following way:

    Code:
    Only registered members can view the code.
    Hello. In keyword_search.tpl we should replace
    <td><div class="keyword_search_input"><input type="text" maxlength="255" name="f[keyword_search]" style="width: 100%;" {if $smarty.post.f.keyword_search}value="{$smarty.post .f.keyword_search}"{/if}/></div></td>
    with
    <td><div class="keyword_search_input"><input type="text" maxlength="255" name="f[keyword_search]" style="width: 100%;" value="{if $smarty.post.f.keyword_search}{$smarty.post.f.keyw ord_search}{else}{$lang.search_hint}{/if}" onfocus="if(this.value == '{$lang.search_hint}')this.value='';" onblur="if(this.value=='')this.value=this.defaultV alue;" /></div></td>
    ?
    Beside this there is something else that i should do? If the replaced code is ok, is not working. Thanks

  4. #4
    Flynax developer
    Join Date
    Jun 2010
    Posts
    239
    Beside this there is something else that i should do? If the replaced code is ok, is not working. Thanks
    Do you added the language key "search_hint" in your admin panel?

  5. #5
    Quote Originally Posted by Vladimir View Post
    Do you added the language key "search_hint" in your admin panel?
    nope. will try again. thanks for the tip. hope to succeed

  6. #6
    Quote Originally Posted by Vladimir View Post
    Do you added the language key "search_hint" in your admin panel?
    This is beyond my ability. Never done something similar so unfortunaly i do not know how to add language key "search_hint".

  7. #7
    Master
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    421
    Hi Petrache Nicolae

    You have several input fields.
    Therefore you have to create various language keys.
    Let us make an example for your keyword search.
    Just minute...
    Last edited by Steffen Buschkemper; September 27, 2012 at 08:14 PM.

  8. #8
    Master
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    421
    Open templates/your_template/tpl/blocks/keyword_search.tpl

    search this part @ line 8

    PHP Code:
    Only registered members can view the code
    and change with the follow code

    PHP Code:
    Only registered members can view the code
    For $lang.search_hint the phrase key = search_hint

    Now go in Admin Panel -> Languages and press the Button "Add a Phrase"

    Key: search_hint
    Value (English): Enter keyword
    System module: User Interface

    PS: If you have installed more languages, then you must also fill out this value for the other languages.

    Press the Button "Add" and thats all.

    keyword.jpg

    Best regards
    Steffen
    Last edited by Steffen Buschkemper; September 27, 2012 at 08:39 PM.

  9. #9
    Quote Originally Posted by Steffen Buschkemper View Post
    Open templates/your_template/tpl/blocks/keyword_search.tpl

    search this part @ line 8

    PHP Code:
    Only registered members can view the code
    and change with the follow code

    PHP Code:
    Only registered members can view the code
    For $lang.search_hint the phrase key = search_hint

    Now go in Admin Panel -> Languages and press the Button "Add a Phrase"

    Key: search_hint
    Value (English): Enter keyword
    System module: User Interface

    PS: If you have installed more languages, then you must also fill out this value for the other languages.

    Press the Button "Add" and thats all.

    Best regards
    Steffen
    nice...i didn't spot the "Add a phrase" button...I had tried to add it via phpmyadmin but too advanced for me...Thank you. Will try it now

  10. #10
    Works fine in case others are interested as well. Credit goes to Vladimir for making this happen and to Steffen Buschkemper for explaing in detail what should be done. Thank you both

+ Reply to Thread