Search Results - Controlling what gets found

General ShopSite user discussion

Search Results - Controlling what gets found

Postby bobthebuilder » Wed Oct 08, 2008 5:47 pm

I'm working on the Search Results page and I have a questions:

1. From what I can tell both Products and Pages are being included in the search results. Is there a way to limit the search results to Products only?

Thanks in advance.
bobthebuilder
 
Posts: 35
Joined: Mon Sep 29, 2008 9:36 am

Postby bobthebuilder » Wed Oct 08, 2008 5:54 pm

I found the "Index" setting on the "Edit Page Content" page. However, if I disable it then no products are found, so I have to enable it in order for products to be found. If there's no way to only have Products found then is there a way that I can control the layout of found pages? Right now it appears pages and products are intermixed.
bobthebuilder
 
Posts: 35
Joined: Mon Sep 29, 2008 9:36 am

Postby Jim » Wed Oct 08, 2008 8:14 pm

Only products are indexed for searching, the page content itself is not indexed.

For each search result you will get back the product and links to the pages that the product is found on. If you don't want to see the page links just make the link template an empty section so nothing will display for the links themselves.

You can also do some coding in the search template to make it so that only product itself displays and not the links.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby bobthebuilder » Wed Oct 08, 2008 8:46 pm

Thanks, just a few follow-up questions:

1. Where is the "link template" defined at? What file?

2. Can you provide some examples of code that I can use in the search template that can make it so that only products are in the results and not page links? I'm currently using the following code:

<table width="99%" align="left" border="0" cellpadding="0" cellspacing="0">
[-- LOOP SEARCH 3 --]
<td valign="center" align="left">&nbsp;[-- SEARCHRESULT --]</td>
[-- END_LOOP SEARCH--]
</table>

Thanks in advance.

-Adam
bobthebuilder
 
Posts: 35
Joined: Mon Sep 29, 2008 9:36 am

Postby bobthebuilder » Wed Oct 08, 2008 9:12 pm

Thanks Jim, I figured out the page link template and I have it working. I now have another problem. As I stated above I'm using the following code for the search results:

<table width="99%" align="left" border="0" cellpadding="0" cellspacing="0">
[-- LOOP SEARCH 3 --]
<td valign="center" align="left">&nbsp;[-- SEARCHRESULT --]</td>
[-- END_LOOP SEARCH--]
</table>

I'm expecting this code to produce a three column table. However, I'm getting the following results:

Column1 Column2 Column3

Product Empty_Cell Product
Empty_Cell Product Empty_Cell
Product Empty_Cell Product
Empty_Cell Product Empty_Cell
Product Empty_Cell Product

As you can see the search results looks like a checker board. I've set the results per page to 15 (a multiple of three).

2. The second issue I've run into is the "Add To Cart" button for products in the search result is non functional. In looking at the code it appears the <form> tags are missing. I'm using a custom Product template, which works on Product Pages, but when I select that template in the Search Layout the Add To Cart button is not working.

Thanks Jim for your quick responses.
bobthebuilder
 
Posts: 35
Joined: Mon Sep 29, 2008 9:36 am

Postby Jim » Thu Oct 09, 2008 6:53 am

When you use the "3" in the loop ShopSite automatically inserts <tr> </tr> tags every 3 times through the loop. Since each time through the loop could result in either a product or a link for a product this complicates the output since some products could have multiple links assigned to them if they are on multiple pages, this results in uneven columns.

Study the Classy search templates (classy_se_template.sst, classy_se_link_template.sst and classy_se_prod_template.sst ) to see how a multi column search result can be implemented.

Essentially you need to control when the table cells and rows are output instead of using the "3" and having ShopSite generate them. You do that by checking what is returned for the search result (a product or link) and formatting the output accordingly.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby JeremeD » Sat Oct 11, 2008 12:28 am

If you can't figure out the classy template, check out my post in this thread: http://support.shopsite.com/forums/view ... ght=search

There's a solution for what you're trying to do. Just modify the class and width attributes as needed.
SD360.com
Certified ShopSite Designer
ShopSite Templates Available Now
JeremeD
 
Posts: 60
Joined: Sat Feb 10, 2007 4:20 pm
Location: Athens, GA


Return to User Forum

Who is online

Users browsing this forum: No registered users and 73 guests