Jump to:

23375 Posts in 18175 Topics by 2866 members

General Questions

SilverStripe Forums » General Questions » Change "Go" to "Search" for search button.

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1105 Views
  • micahsheets
    Avatar
    Community Member
    164 Posts

    Change "Go" to "Search" for search button. Link to this post

    I know that there is some way to do this using the translatable code but that seems like a hack to me. I would rather just have control over the text directly. I am using SS 2.4.3 but I tried to just use the old way of creating my own instance of a SearchField but I get errors when I try to submit it.

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: Change "Go" to "Search" for search button. Link to this post

    Its *meant* to be done via a custom translatable file... Otherwise you modify the core or you have to redundantly replace it.

    The point of the _t function is so you can do exactly what you're asking to do.

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: Change "Go" to "Search" for search button. Link to this post

    I see what you mean however I don't see the logic in use a system meant for localization to be used to change the text of something when there is only one localization and it should be the default. Localization is only used when you have more than one and need to change the default to another language. So I can certainly do it that way but it is still a hack in my opinion.

  • ambient
    Avatar
    Community Member
    123 Posts

    Re: Change "Go" to "Search" for search button. Link to this post

    In case anyone is looking for a solution to changing 'go' to Other Text or an image this worked for me:

    In en_US.php or your relevent language file change line 689(approx) -

    $lang['en_US']['SearchForm']['GO'] = 'Go';


    to

    $lang['en_US']['SearchForm']['GO'] = 'Other Text';


    or

    $lang['en_US']['SearchForm']['GO'] = '';


    if you want to add an image instead using background-image in .search form input.action in the search css

    1105 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.