Presentation of search results closely follows the implementation at the MD spec site:
Here is a visual (non-functional) mockup in plain HTML.
search-results.zip (447.1 KB)
And here is a screenshot of the top of a search results page.
Here I will specify each point in detail. Note that the line between UI for search and search functionality is not always clear. What i describe is an ideal to aim for, and we implement what we can.
##General
Use sans serif throughout, except where noted.
Container has the same width as suttaplex list.
Show ten results.
When a search term is the head word in a dictionary, that should show as the top result.
##Header
This is as normal, with the following details
Main title says : āSuttaCentral ā search resultsā
Use a distinct header color. Green means āGo!ā Use MD green 600 = #43A047
#search options
The aim of search results is to immediately get the user what they are looking for. We should aim to minimize or eliminate completely any complications of UI.
Old version has options for āadvancedā (which is actually āprimitiveā) and ādetailsā. These should be eliminated.
Occasionally a search term might show so many results that additional filtering is required. This is especially the case in examples such as the one shown, where SÄvatthÄ« shows up frequently in root texts, translations, and dictionaries. To handle such cases, use a dropdown menu, with options:
- All
- Root texts
- Translations
- Dictionaries
This dropdown is normally hidden, and only shows when necessary. The two necessary conditions are:
- The results are in more than one category of root texts, translations, and dictionaries, and
- there are more than ten results in total
When a search meets both these requirements, show the dropdown.
#language filtering
The search results show for your primary language, as selected for the main UI, as well as source texts. Generally, it will be rare for a term to appear in more than one language. Exceptions include:
- proper names
- technical terms, which may be left untranslated
- Chinese, which occurs in both root texts and translations.
If it is necessary to filter language additionally, it should be adequate to use the main site language filter. Adding an extra language filter will essentially do the same thing, adding complexity to little use.
Language filtering is determined by main site language selector.
##Results heading
Main <h1>
heading for results gives the number of results.
Knowing the number of results is useful on SC. Rather than adding extra text saying ā10 of 64 resultsā or something, it is cleaner to just add it in the heading.
Style the term in the heading in primary green, bold, serif.
##Results
Entries follow style on material.io. The main layout of the search results is similar to the suttaplex list. The text sizes, vertical metrics, etc. should all match.
Beneath the results heading, we have a line of secondary text that shows:
- For text results, the URL
- For dictionary entries, the name of the dictionary.
Metrics and styles match suttaplex (except where noted)
Heading of search results is <h2>
, styled weight normal, sans, primary green.
Use primary green and bold to highlight the search term in results.
Use a simple divider between results.
##Load More
Rather than paginated results, load more results as the user scrolls to the bottom. In case auto-load is flaky, have a load more button at the bottom. Load an additional ten results each time. Here is a mockup.
##Map
The Google map works well, and should be promoted more.
Show the map on main search results when the search term is a head word for a dictionary entry that is in the map
Show the map at full width (rather than 50% as old version)
#dictionary definitions
When you click on a search result for a dictionary entry, you get a page with entries from the several dictionaries that we host, as well as a sidebar listing āadjacent termsā and āsimilar spellingā. Generally speaking, this will remain the same, adjusted for the MD design.
The name of the dictionary can go as secondary text above the term, rather than at the side as in the old design. This creates a minor inconsistency with the main search results, where the name of the dictionary is below the term. It seems hard to avoid this, however, as there may be more than one result per dictionary.
Otherwise the structure of entries remains unchanged, with head word, grammatical information as secondary text line, then main entry. Etymological info goes as secondary text at the end.
Note that the list structures of entries especially in PTS dict can be quite intricate. The default appearance of HTML lists is tricky to modify, so this is handled with some fairly delicate CSS. Ensure that the appropriate list CSS is applied here.
As for the sidebar, this can remain as is. A couple of details. We should remove the right-arrow pointing to the current term. It is enough for this to be bolded and highlighted with the primary green. Other terms can simply be main text color, with headings in bold and in secondary text color.
On narrow screens, shift the sidebar to the bottom of the page.