Using VAR with CALL

General ShopSite user discussion

Using VAR with CALL

Postby bookman » Wed May 07, 2008 1:39 pm

I am using a perl cgi to do some fixups on the url for the search results and would like to maintain the result as a VAR, something like

Code: Select all
[-- VAR.MYURL [-- CALL urlfix.cgi (PAGE.Field1, PAGE.Field2) --] --]


but when I make the call, SS throws errors "VAR.: 6 parameters found for this tag, expecting 2".

Is there some way to do this?
bookman
 
Posts: 17
Joined: Wed Mar 26, 2008 8:59 pm

Postby loren_d_c » Wed May 07, 2008 1:47 pm

No, a CALL tag cannot return data to a VAR. The data returned by the program specified in the CALL tag can only be printed out in the page.

If you want to use the same returned data multiple places on the page, perhaps you should put the CALL tag in a JavaScript variable in the page's head section, then via JavaScript placed at other locations in the page you can use that same data.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby bookman » Wed May 07, 2008 2:01 pm

Thanks Loren. I was afraid this might be the case. I was trying to aviod the necessity of using JS on the front end.

In this case, I want to use the product image and a "Read More" link to get to the product from the search page rather than a list of links. Is there a way of doing this? I am using a customized version of the cleanSearch template.
bookman
 
Posts: 17
Joined: Wed Mar 26, 2008 8:59 pm

Postby loren_d_c » Wed May 07, 2008 4:05 pm

So what page, exactly, are you trying to link to? A Page that your Product has been assigned to, or the Product's More Information Page?

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby bookman » Wed May 07, 2008 4:54 pm

I am linking to a page that contains a list of books not a more info page. Easier to see than explain. You can see my staging site at http://www.wbstage.com/edu/steiner_waldorf.htm

If you then do a search on "parents" you will see the search page with two items. I took your advice and did some JS magic and that works fine.

The problem is that the site contains multiple domains. For instance you can go to http://www.csstage.com/yarns/zitron/zi_loft.htm (this page is broken at present) and do a search on "parents" again and the seach engine returns the same items.

Also, you will notice that the search engine runs in the bnstage domain which is the root domian for the site. Each shop on the site is a subdirectory of the root and has its own domain. This is the reason for the url fixup so that the link back to the page containing the information about a product found in the seach returns to the correct domain. Without it, the process is pretty easy but the user would wind up in bnstage not the real domain. Not sure if that is clear.

The reason behind all this is that we have considerable time and money invested in these domains not to mention the links all over the web that have accumulated in the last 10 years or so, so we want to take advantage of that in our move to SS. A further constraint is that we want the user to be able to move among the domains retaining the same shopping cart, something that our users are used to doing.
bookman
 
Posts: 17
Joined: Wed Mar 26, 2008 8:59 pm


Return to User Forum

Who is online

Users browsing this forum: No registered users and 66 guests