Custom Search templates

General ShopSite user discussion

Custom Search templates

Postby Paul Schuster » Wed Nov 08, 2006 11:27 am

Has anyone here done this? Would you help a novice? I am using a HTML document that reflects the look of my regular pages as a search template. I just want to add in the necessary tags to make the search results appear in a page that looks like every other page. So I shouldn’t have a need for many of the “back office” tags. The available documentation is not well organized and I'm wasting a ton of time trying to work it out.

My first question is what are the barebones necessary tags that would go in an html document to display the results of a search query? I just want to show a link to the product page with a short description and photo.

Second question: What search form tags are needed on that pages that the search query is entered from?
Paul Schuster
 

Postby Jim » Wed Nov 08, 2006 1:57 pm

There are 3 templates involved in a search results page.
1. Search Template: Which is similar to a normal page template
2. Link Template Override Which is similar to the Define Links to page section of a page template
3. Product Template Override Which is similar to a regular product template

for #1 you need at a minimum to add the [-- Define Page --] and [-- End_Define Page --] around your html for the page. And you need to add [-- Loop Search --] [-- searchresult --] [-- end_loop search --] Where you want the results to appear on the page.

for #2 You need a section like
[-- DEFINE LINK_TO_PAGE --]
# here you put the tags to display the link to the product page as you want it to look. Something like
<a href="[--OUTPUT_DIRECTORY_URL--]/[--Page.FileName--]">[--PAGE.LinkGraphic--]<b>[-- IF PAGE.LinkName--][--PAGE.LinkName--][--ELSE--]<!--[--PAGE.Name--]-->[--END_IF--]</b></a>
[-- END_DEFINE LINK_TO_PAGE --]

for #3 You can use your regular product template or define a new product template that displays the product as you want it to look. This would be at a minimum
[-- define product --]
# here you put the tags to display the product the way you want it.
[-- product.name --] &nbsp; [-- product.graphic --] &nbsp; [-- product.price --]
[-- end_define product --]

For your second question the tag to display the search form on a store page is [-- SEARCH_FORM --]
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby Jeff » Wed Nov 08, 2006 9:42 pm

Yes, key point is that three templates are involved in the search process which isn't obvious from the SS help. There was some discussion here about search templates about 8 months ago that enabled me to produce a decent search results page complete with product graphics.

Never did figure out how to get a line (horizontal rule) between each result. Whole process was pretty exhausting for a non-techie.

Felt better when I saw how few SS sites use customized search result pages. LOL
Jeff
 
Posts: 97
Joined: Wed Aug 16, 2006 9:40 am
Location: St. Louis MO

Search Function

Postby Paul Schuster » Fri Nov 10, 2006 1:00 pm

Thanks to Jim and Jeff. Youre helping to clear away the fog. I am still a little fuzzy though. Could you confirm a couple things?

So the [-- SEARCH_FORM --] tag alone will display a basic search form wherever it sits on an html page?

And as for the following Link Template Override tags you gave as an example...

[-- DEFINE LINK_TO_PAGE --]
<a href="[--OUTPUT_DIRECTORY_URL--]/[--Page.FileName--]">[--PAGE.LinkGraphic--]<b>[-- IF PAGE.LinkName--][--PAGE.LinkName--][--ELSE--]<!--[--PAGE.Name--]-->[--END_IF--]</b></a>
[-- END_DEFINE LINK_TO_PAGE --]

...Do I need to change anything in the tags themselves? Where does this template go? Is it coded into the search template or is it a stand-alone document? I don't see a place to upload a links template on the Merchandising Tools page of SS manager 8.

Paul
Paul Schuster
 

Postby Jim » Fri Nov 10, 2006 10:03 pm

The [-- SEARCH_FORM --] tag alone will display a basic search form wherever it sits on a ShopSite page template (and perhaps the More info section of a Product tempate) It will only work when the pages are generated by ShopSite. If you need to put the code on an html page that is created outside of ShopSite you can copy the code for the search form from a ShopSite generated page and paste it into your html page.

The code for the link needs to be in a PAGE template so that is the section where you would put your template. It would be best in a template file by itself. You don't have to include the [-- define page --] section in the template since only the [-- DEFINE LINK_TO_PAGE --] will be used.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Custom Search Template

Postby Paul Schuster » Wed Nov 15, 2006 12:52 am

Jim- thank you once again! Knowing that I needed to get the code from a SS generated page was the ticket! Youre the best!

Paul
Paul Schuster
 

Custom Link Override Template

Postby Paul Schuster » Thu Nov 16, 2006 12:48 pm

How does SS 8.1 Manager call up a link override template if it is just sitting there as a page template? I have uploaded mine to the Page Template section of the Custom templates section under Merchandising tools in the backoffice (shows up in text box with my custom storepage template). How do I ensure its using it? Am I missing something?
Paul Schuster
 

Postby Jim » Thu Nov 16, 2006 2:03 pm

Preferences > Search Settings
Set the "Link Template Override:" template name and check the box.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 51 guests