PDA

View Full Version : Add Text to Search Result Page


JG867
05-05-2008, 08:29 PM
Hi,

I'm using the javascript version of your search engine due to its distribution restraints (ftp & cdrom). Because of some conflicts I have with the javascripting on my pages, I cannot "jump to highlighted match" for a search term. I'm okay with that - because the user can still see the highlighted search term if they scroll.

However, I'd like to add a sentence on the search results page to indicate to the user that they should scroll to locate their highlighted search term when clicking on a link in their search results. Often times, the highlighted search term is near the bottom of the page. I can add a sentence by modifying the search.html file, but I am not happy with its placement. I need help!

Here's my setup:
I have added a search form to my home page/table of contents. In addition, I have left the generic search form in the search results page, so the form field displays there too, if the user needs to perform subsequent searches. It is on this page, between the "number of results found" and the search results listing I would like to add a sentence telling users to scroll to locate the highlighted search term. I have no idea where in the html code I can place this sentence so that it displays where I want it.

For instance, the layout of my search results page is this:

Second search box placed at top of page
"Search results for: ABC"
"18 results found in all categories"
"2 pages of results"
1. First search result link.
2. Second search result link.
etc.

I would like a sentence added after the "2 pages of results" and before the first result link.

Any suggestions? Another javascript? :(
Thanks!

Ray
05-06-2008, 01:51 AM
The easiest approach would be to modify the text in the Language file. This can be found on the "Languages" tab of the Configuration window. You can click "Edit" to modify the current ZLANG file (or create a new copy to modify).

Here, you can modify the text for "pages of results" so that it is followed by the text you want. You can also use HTML here, but take into regard the output HTML that it will be inserted into.

Refer to chapter 7.2 of the Users Guide (http://www.wrensoft.com/zoom/usersguide.html) for more information.

JG867
05-06-2008, 04:57 AM
Ok, well, although I have studied the user doc (which is awesome, btw) at great length, I must have missed the fact that the ZLANG file contains such fields and they can be modified.

So, I modified the "pages of results" sentence and included, in html, the information I required. (I also changed a few other fields). Easy enough!

Thanks again for the quick reply! Issue solved!

JG867
05-06-2008, 02:41 PM
Just to follow up (in case someone else needs this information)....

Initially, I added a sentence to the "# pages of results" phrase. This worked great. However, when a search yields only "one" page of results the phrase "# pages of results" does not display, and therefore my new sentence does not display.

To correct this, I moved the newly added sentence after the "# of results found" phrase - that way it will always display (and yes, even if 0 results are found, but that's okay).

Thanks again!