Skip to main content

Changing search results text

Comments

18 comments

  • Frank Martin

    Larisa,

    Here's a link to the html5 forum posting that provides an example of how to modify the "Search.." box text. 

    https://support.geocortex.com/how-to-change-the-search-box-text-on-two-different-html5-viewers

    You can also change the "No results to display" test by the same method.

     

    Frank

    0
  • Permanently deleted user

    Hi Frank 

    Do you know if I can change this per site? I have a few different sites that have different search capabilities adn I would like to change the search text to reflect each individual site. for example" Search for a Park or Park Amenity..." and "Search for and address..."

    thanks

    Larisa

    0
  • Permanently deleted user

    Let me try that again without the spelling erroros! lol!

    Do you know if I can change this per site? I have a few different sites that have different search capabilities and I would like to change the search text to reflect each individual site. for example" Search for a Park or Park Amenity..." and "Search for an address..."

     

    thanks!

    0
  • Nico Burgerhart

    The article shows how to create different texts for different sites.

    0
  • Frank Martin

    Hi Larisa,

    Yes, you can.  In the viewer "Locales" folder,  you can create multiple copies of mapping.en-US.json.js.  In each one you can change the language-search-placerholder text to reflect you search text.  For example, a copy of the mapping.en-US.json.js file could be renamed to mapping.en-HometownParks.json.js and contain the value "Search for a Park..." for the language-search-placerholder text.  Then, in your site( {site}\Viewers\{viewer name}\VirtualDirectory\Resources\Config\Default), edit the .json file (desktop, table, and/or handheld) that you want to change.   Find the id "Mapping" and change the locale uri to the name of the locale file you'd like to use for that site.  Here's a code snippet.

    Original code:

    {

     

            "id": "Mapping",

     

            "uri": "Resources/Compiled/Mapping.js",

     

            "locales": [

     

              {

     

                "locale": "en-US",

     

                "uri": "Resources/Locales/Mapping.en-US.json.js"

     

              }

     

            ]

     

          },

    change to:

    {

     

            "id": "Mapping",

     

            "uri": "Resources/Compiled/Mapping.js",

     

            "locales": [

     

              {

     

                "locale": "en-US",

     

                "uri": "Resources/Locales/Mapping.en-HometownParks.json.js"

     

              }

     

            ]

     

          },

    Hope this helps.

    Frank

    0
  • Permanently deleted user

    Frank,

    Thank you! That is exactly what I was looking for. Thank you for the help.

    Larisa

    0
  • Frank Martin

    Larisa,

    You're welcome.  Glad I could help.

    Frank

    0
  • Permanently deleted user

    I tried to change the search box text exactly as the article suggests with no luck.  What could I possibly be doing wrong?

     

    0
  • Permanently deleted user

    Hi Rebecca,

    What Browser are you suign to view the app? I was able to change the Global Search Box text to say something other than "Search...", however this only worked for the Chrome Viewer. When I opened the application in IE, it would still reflect the original search text, but when I took that exact same url and opened it in Chrome...no problem it worked.

    Larisa

    0
  • Permanently deleted user

    I'm using Firefox and Internet Explorer.  I didn't try it in Chrome.  That's not very useful if it doesn't work in all browsers! Too bad. Did you ever manage to get the "no results to display" text changed or was it the same sort of issue? 

    0
  • Permanently deleted user

    I never did get the "no results to display " text to change. i could not figure out where to change it. If you ever figure that one out , please let me know.:)

    0
  • Chris Roberts

    Hi

    Did anyone get an answer to this? I cant seem to get the change of text to reflect in IE, tried completing deleting the browser cache, does IE create a copy of some file somewhere in a profile setting?

    Chrome it picked the text change up no problems.

    Cheers

    Chris

    0
  • Permanently deleted user

    Hi Chris,

    Nope, looks like it is an issue with IE and Chrome. No matter what I try it will not work for me in IE.

    If I hear anything I will let you know.

    Larisa

    0
  • Permanently deleted user

    I've noticed my text changes not taking effect as well. In other posts it is recommended to change the Mapping.en-US.json.js file. I made changes there an I was not seeing my changes. I then tried to modify the Mapping.Infrastructure.en-US.json.js file in the same folder and my changes showed up right away and in different browsers. Hope this helps someone.

    Mike

    0
  • Chris Roberts

    The Mapping.infrastructure file doesn't seem to have any reference to the Global Search text (to my knowledge). Tried changing: "language-menu-global-search" on the off chance, but no luck.

    Somewhere IE must cache this json file the first time a Gecortex Viewer is loaded, and this doesnt appear site specific, none of my HTML5 viewers will pick up the changes to the  Mapping.en-US.json.js file in IE.

    If anyone from Latitude are monitoring this thread, do you have any advice on how to get IE to reload/reread the Mapping.en-US.json.js file?

    As I mentioned Chrome, Safari and FireFox dont seem to have an issue.

    Cheers

    Chris

    0
  • Chris Roberts
    Hi

     

    After some consultation with our local reseller, it would appear that IE fails to calling the default Mapping.en-US.json.js file.

     

    We have come up with a solution (of sorts) for  this.

     

    The workaround is to call the viewer in the following way…

     

    http://[YourServer].sa.gov.au/[YourViewer]/Index.html?locale=en-US&configBase=http://[YourServer].sa.gov.au/Geocortex/Essentials/[YourInstance]/REST/sites/[YourSite]/viewers/[YourViewer]/virtualdirectory/Resources/Config/Default

     

    Note the ?locale=en-US& after the Index.html above.

     

    If you are using a shortened url below is what I have edited the url of one of our public site to look like.

     

    http://spatialwebapps.environment.sa.gov.au/naturemaps/?locale=en-US&viewer=naturemaps

     

    Doing this extra call seems to force the regional javascript to be called to overcome the issue.

     

    Cheers

     

    Chris

     

     

     
    0
  • Permanently deleted user
    Hi,

     

    I was having the same issue and I finally got the replacement text to appear across all browsers by adding multiple "locales" in the Desktop.json.js file, e.g.: { "id": "Mapping", "uri": "Resources/Compiled/Mapping.js", "locales": [ { "locale": "en-AU", "uri": "Resources/Locales/Mapping.en-FESMaps.json.js" }, { "locale": "en-US", "uri": "Resources/Locales/Mapping.en-FESMaps.json.js" } ] },

     

    It turns out the language setting on my IE was set to English (Australia). This was set by our sys admins and I had no control over it. Once the "locale": "en-AU" section was added to the Desktop.json.js file, I guess IE could correctly map to the approriate section in the file because the replacement text appeared in my global search box in IE.

     

    I suspect that Chris, in the post above, is in a similar situation, but is forcing his viewer to use the "locale": "en-US" section in Desktop.json.js through the URL parameter. 

     

    A couple of points to note...  The language settings in my FF and Chrome were set to Englush (US) so I did some further testing and removed the "locale": "en-US" section from Desktop.json.js and changed the languages in FF and Chrome to English (Australia) - replicating the setup I had with IE. FF worked ok but Chrome didn't like this. The replacement text in Chrome will only appear for me if I have a "locale": "en-US" section in Desktop.json.js.

     

    Cheers,

     

    Dave

     

     
    0
  • Chris Roberts
    Nice one Dave!

     

    I'll do the same to my sites Desktop.json.js file to pick up on those urls out there that were book marked prior to me updating/hacking it, to fix the issues we were having.

     

    Cheers

     

    Chris
    0

Please sign in to leave a comment.