Possible to assign [-- SearchString --] to a VAR

General ShopSite user discussion

Possible to assign [-- SearchString --] to a VAR

Postby tfoy » Sat Jul 26, 2008 12:40 pm

Is it possible to assign [-- SearchString --] to a VAR on the Search Template?

Something along the following lines that could display a different graphic based on a keyword entered?

[-- VAR.banner SearchString --]

[ -- IF VAR.banner "book" <--- book as an example of keyword searched for

<img src="http://mydomain.com/banner1.gif" width="1" height="1" alt="" />

[-- ELSE --]
[-- END_IF --]


Thanks
Tom
tfoy
 
Posts: 32
Joined: Wed Apr 16, 2008 10:34 am

Postby Jim » Mon Jul 28, 2008 9:22 am

It is not possible to assign [-- SearchString --] to a var.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby tfoy » Mon Jul 28, 2008 10:23 am

Jim,

Kind of figured as I did not see it in the help section, but wanted to be sure.



Thanks
Tom
tfoy
 
Posts: 32
Joined: Wed Apr 16, 2008 10:34 am

Postby loren_d_c » Mon Jul 28, 2008 11:34 am

You could output [-- SearchString --] into some JavaScript (basically assigning its value to a JavaScript var) and then use subsequent JavaScript to check the value and document.write the particular HTML you want to create based on the value.
Last edited by loren_d_c on Mon Jul 28, 2008 11:40 am, edited 1 time in total.
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby tfoy » Mon Jul 28, 2008 11:40 am

Thanks Loren,

I think I will give that a try.


Tom
tfoy
 
Posts: 32
Joined: Wed Apr 16, 2008 10:34 am


Return to User Forum

Who is online

Users browsing this forum: No registered users and 130 guests