The ScreenSteps Online Knowledge Base Everything you need to know about ScreenSteps
Blue mango logo white 250
  • Table of Contents
  • Contact Us
ScreenSteps Documentation » API Examples » Adding a ScreenSteps Live Search widget to your site

Topics

  • WordPress 5
    • What do I need to have to get started?
    • A quick note about WordPress permalinks
    • How do I install the ScreenSteps Live plugin?
    • How do I configure the ScreenSteps Live plugin?
    • How do I view content?
  • HTML and Javascript Widgets 1
    • Adding a ScreenSteps Live Search widget to your site
  • FogBugz Widgets 1
    • Adding a ScreenSteps Live widget to FogBugz
  • iFrame - Search From Any Web Page 1
    • Inserting a ScreenSteps Live iframe into a web page
  • Reference Lessons 4
    • Create an API Access user in ScreenSteps Live
    • Finding Your Space ID or Permalink
    • How to create a Zendesk CSS Widget
    • How to convert your old Zendesk template to the 2011 template

Quicklinks

  • Downloads
  • View forums
  • Submit a help request
  • Contact us
  • Retrieve a lost license key

Last Updated

Jul 27, 2010

Download Manual PDF

Other Resources

  • ScreenSteps Desktop & Workgroup

  • ScreenSteps 2.9
  • ScreenSteps Workgroup
  • Customizing HTML Templates
  • ScreenSteps: Tips & Tricks
  • Creating Word Templates
  • Publishing to Blogs & Wikis
  • ScreenSteps Live

  • ScreenSteps Live
  • Setting up a New Admin, Editor or Author on ScreenSteps Live
  • ScreenSteps Live Support Client
  • Integrating ScreenSteps Live With Other Services
  • Collaborating on ScreenSteps Live
  • ScreenSteps Live Remote Authentication
  • ScreenSteps Live API
  • API Examples
  • Implementation Guides

  • Creating a Software Manual With ScreenSteps
  • Creating a ScreenSteps Live Support Site
  • Zendesk and ScreenSteps Live
  • Help Scout and ScreenSteps Live
  • FAQs

  • FAQs

Comments

0 comments for this lesson

  • Prev: How do I view content?
  • Next: Adding a ScreenSteps Live widget to FogBugz

Adding a ScreenSteps Live Search widget to your site

This lesson will show you how to add a ScreenSteps Live search widget to any site you like. There are a couple of requirements though:

1. You will need to have javascript enabled.
2. You will need include the jQuery javascript library (don't worry, we will show you how).

Reference Javascript File

Reference_javascript_file

There are two javascript files that you will need to reference from your site:

1. jQuery
2. The ScreenSteps Live Javascript file

Include this code in your page somewhere:

<script src="http://screenstepslive.com/javascripts/push/screenstepslive.js" type="text/javascript" charset="utf-8"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>

NOTE: If your site is already using jQuery then you do not need to include it again.

Enter Settings

Enter_settings

You will want to enter some basic settings to get your widget up and running.

    <script type="text/javascript" charset="utf-8">
     ScreenStepsLiveSearchOptions = {
domain: "youraccount.screenstepslive.com",
space: "my_space",
update_element: "search_results",
username: "your_login",
password: "your_password",
use_ssl: true
}
    </script>

 

 

1. domain - Your ScreenSteps Live domain name.
2. space - The id or permalink of your space.
3. update_element - This is the id of the div where search results will be inserted into your web page (you'll see where to use this later in this lesson).
4. username, password - We strongly recommend that you don't use an administrator user name and password here. Set up an api access user to use in your search widget.
5. use_ssl - Only set "use_ssl" to true if your ScreenSteps Live account allows SSL access.

Create a Form

Create_a_form

Now you need to create a form with a field where you can insert your search text. You can do this however your would like but the html below should work fine for you:

<form id="screenstepslive-search" action="">
<p><input type="text" id="screenstepslive-search-field" value="" name="text"></input></p>
<p><input type="submit" value="Search"></p>
</form>

Create a Div to Display Results

Create_a_div_to_display_results

Now add a section where your search results will be displayed. The id of the div needs to match the id you entered for the update_element above.

<h3>Search Results</h3>
<div id="search_results"></div>

Attach Search Function To Form

Attach_search_function_to_form

Now we are going to use jQuery to attach the search functionality to the form.
    
    jQuery.noConflict();

jQuery(document).ready(function($) {
jQuery('#screenstepslive-search').submit(function(e){
e.preventDefault();
search_string = jQuery('#screenstepslive-search input#screenstepslive-search-field').val();
SearchScreenStepsLiveSpace(search_string);
})
});

In case you are interested we this is what we are doing:

1. Putting jQuery into no conflict mode so it won't bother any other javascript libraries you might be using on your page.
2. Waiting for the page to load and binding a function to the search form that will get triggered when the form is submitted.
3. Preventing the default action of the form and getting the search string that the user entered.
4. Calling the SearchScreenStepsLiveSpace function with the search string from the pervious step.

Search Away!

Search_away_

Here is an "unstyled" example of what the widget and search results will look like. You can style this to look however you would like.

  • Prev: How do I view content?
  • Next: Adding a ScreenSteps Live widget to FogBugz

Comments (0)

Add your comment

E-Mail me when someone replies to this comment
Blue Mango Learning Systems © 2012