Adding Columns to Search Results
The search function in ShopSite treats products and links to pages that contain those products as separate items. If you turn on columns in the search results, the resulting products and page links would take up separate columns, creating a visual mess of scattered results that is difficult to read. To have search results appear in neat columns you would need to really customize your template, use specific with DIV tags or setup ShopSite to stop displaying page links. This tutorial will go through the third option, not displaying page links with the search results. By following these steps, you can have your store display the search results in neat columns.
- Go to Merchandising > Custom Templates > Advanced, and make a copy of the search_default search template.
- Locate the following within that template:
[-- VAR.pa_search_result "false" --]
[-- LOOP SEARCH --]
[-- IF SEARCHLINK --]
<tr>
<td></td>
<td align="left" valign="top">
<b>
[-- END_IF --]
[-- SEARCHRESULT --]
[-- IF SEARCHLINK --]
</b>
</td>
<td></td>
<td></td>
</tr>
[-- END_IF --]
[-- VAR.pa_search_result "true" --]
[-- END_LOOP SEARCH--]
- Replace the code above with the following code.
[-- VAR.pa_search_result "false" --]
[-- LOOP SEARCH 8 --]
[-- IF SEARCHLINK --]
<!--
[-- END_IF --]
<td valign="top">[-- SEARCHRESULT --]</td>
[-- IF SEARCHLINK --]
-->
[-- END_IF --]
[-- VAR.pa_search_result "true" --]
[-- END_LOOP SEARCH--]
- Within the [-- LOOP SEARCH --] tag add twice the number of columns that you want. For example, if you would like 4 columns your tag would be [-- LOOP SEARCH 8 --].
- Go to Products > Edit Product Info, and for the Search Destination option select anything except "Store". The reason to do this is because the search product results and search link results are both still being looped on the search results screen. So if you have a product assigned to 5 pages, the product result will show up on the search results screen as well as the 5 page links that the product is assigned on. This will take up 5 of the cells for that row on the search results screen. If you change the search destination to "made" or "more info" then you will only have one page link per product and you can take this into account when setting up the LOOP SEARCH feature in your search results template. You will want to change the Search Destination for all products.
Note: you can change this setting globally in ShopSite Pro by going to Products > highlighting all your products > PowerEdit, and select the option for "Search Make Page" and choose to edit that field globally.
- Set the search templates. Last you will want to go to Preferences > Search Settings > Search Layout and set the Search Template to your custom search template. Set the Link Template Override to the search_link template, and set the Product Template Override to the DefaultCustomProductTemplate.