Announcement

Collapse
No announcement yet.

Linking to a custom variable's search results

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Linking to a custom variable's search results

    Hi guys, i'm using a custom variable with the (oh so original) title 'Brand'. I've set up an image on the product pages that shows the product's brand and rather than set up endless custom lists I decided i'd link it to the search results page for that brand.

    The link for the search results page is as follows with the brand being handled in the url. Whilst I could use the hardcoded url and just replace the brand terms in red below, is there a better way of doing this?

    Code:
    http://www.MYDOMAIN.co.uk/cgi-bin/ss900001.pl?RANDOM=NETQUOTEVAR%3ARANDOM&PAGE=SEARCH&SS=&TB=A&PR=-1&S_Brand0_0=Product+Brand&GB=A&ACTION=Search
    I noticed some lists use <actinic:variable name="SearchCGIURL" /> but doesnt this link to a specific result rather than the results page? The gaps in my knowledge of actinic are closing but the whole cgi-bin/perl side of things still eludes me.

    Cheers, Rob
    Golf Grips Direct
    Hobby Tools

    #2
    Hey guys, after some fiddling i've got the link to my brand search results working without hardcoding the links, here's my anchor tag:
    Code:
    <a href="<actinic:variable name="SearchCGIURL" />?PAGE=SEARCH&amp;SS=&amp;TB=A&amp;PR=-1&amp;S_Brand0_0=<actinic:block php="true" >
    	$cleanvar = str_replace(" ", "+", "<actinic:variable name="Brand" />");
    	echo $cleanvar;
    	</actinic:block>&amp;NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22HiddenFields%22%20%2f%3e%20%21%3d%20%22%22">&amp;SHOP=<Actinic:Variable Name="HiddenFields"/></actinic:block>&amp;ACTION=Search">
    
    </a>
    This uses the custom product variable 'Brand'. I threw in some php to replace the spaces in some of my brands with '+' symbols, without this if there are any spaces in a brand the link wont work. Replace the part in red with your custom variable from the search results url and the Brand variable with your own custom variable.

    Thought it might be useful for someone

    Rob
    Golf Grips Direct
    Hobby Tools

    Comment

    Working...
    X