My Sellerdeck Account | Free Trial

Sellerdeck Community & Knowledge Base

Go Back   Sellerdeck Community > Knowledge Base > Content Management

Search powered by Google
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Search this Thread Useful Thread? Display Modes
Old 26-Jul-2016, 03:50 PM
G.W.Green G.W.Green is offline
Join Date: Sep 2005
Full Name: G.W.Green
Posts: 485
Thanks: 0
Thanked 68 Times in 43 Posts
How do I add my own variables to the filter results?

The SellerDeck main help describes how to include your own variables in the search results. The same variables can also be included in filter results. However since these pages are controlled by Javascript, a small snippet of Javascript must be used instead of the code described in the help. This article describes the general method through a worked example.

NB 'Searchable' and 'Upload' must be ticked in the variable's definition in the Library.

We will use the 'brand' variable as an example, but the same method will work with any variable you have added yourself.
  1. Select 'Library' from the ‘Design’ menu and click the 'Layouts' tab.
  2. Scroll down and expand the 'Search Results' layout type.
  3. Double-click the ‘Standard Search Result’ layout.
  4. In the ‘Layout Code’ window, position the cursor at the top of the layout and paste the following:
    <script type="text/javascript">
    		function Template1(vbrand)
    		var sResult = 'Brand: ' + vbrand;
    		return (sResult);
    (Instead of 'brand' you would use the name of your own variable).

  5. Now click where you want your variable to appear, and insert the following:
    <Actinic:ScriptFunctionCall>Template1('<actinic:variable searchresultvariable="true" name="brand" />')</Actinic:ScriptFunctionCall>
    (Again, substitute your own variable name for 'brand')

  6. Click ‘OK’, then ‘Close’ and upload the site.
    The method can also be used to insert multiple variables. You can also include the Product Reference using the variable SearchResultProductReference, but this requires the following Javascript change and the variable must not have the attribute 'searchresultvariable="true"'.
  7. Open your site folder in Windows Explorer and find the file 'actinicsearch.js'.
  8. Open the file in Notepad and find the following line:
    sTemplate = sTemplate.replace(/(<Actinic:S_STOCK><\/Actinic:S_STOCK>)/ig, objProductDetails.m_nStockLevel);
  9. Insert the following line of code immediately below it:
    sTemplate = sTemplate.replace(/(<Actinic:S_PRODREF><\/Actinic:S_PRODREF>)/ig, objProductDetails.m_sProdRef);
  10. Save and close the file and upload the site.

For example, to include both the Brand and the Product Reference, with an appropriate label for each, you would add the following script functions:

<script type="text/javascript">
		function Template1(vSearchResultProductReference)
		var sResult = 'Ref: ' + vSearchResultProductReference;
		return (sResult);
		function Template2(vbrand)
		var sResult = 'Brand: ' + vbrand;
		return (sResult);
and the following calls (which can be put in separate places in the layout if required):
<Actinic:ScriptFunctionCall>Template1('<actinic:variable name="SearchResultProductReference" />')</Actinic:ScriptFunctionCall>
<Actinic:ScriptFunctionCall>Template2('<actinic:variable searchresultvariable="true" name="brand" />')</Actinic:ScriptFunctionCall>
Reply With Quote
The Following 2 Users Say Thank You to G.W.Green For This Useful Post:
fergusw (27-Jul-2016), maroni35 (02-Aug-2016)

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT. The time now is 05:53 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.