rss_live_search

Plugin Details

Download:
rss_live_search  v0.7
Textpattern Forum:
View discussion
Plugin Type:
Regular
Current Version:
0.7
Status on this site:
Active

I really can’t take all the credit for this one. Much of the work was already done for me by Markus Kniebes who created the LiveSearch Extension for Textpattern which in turn is based on the BitFlux LiveSearch Solution

The plugin brings live search functionality to Textpattern with a very simple installation process. Once installed, search results will be returned “live” as users type into the search input field. You can see it in action on my site search above.


Revision History

// Version 0.1 – 05/05/2005 – Initial release
// Version 0.2 – 05/09/2005 – Added inputvalue, inputsize, showbutton, buttonval, autocompleteoff, form, showdate.
// Version 0.5 – 11/03/2005 – Fixed blank entry bug. Added showsection. Probably added some more, but I don’t remember.
//Version 0.6 – 9/25/2006 – Added dateformat. Search sticky articles.
//Version 0.7 – 1/18/2007 – IE 7 Fixes.

How to Use This Plugin

  1. Install and activate the plugin of course.
  2. Add a call to <txp:rss_live_search_js /> in the <head> section of your page.
  3. Add a call to <txp:rss_live_search /> wherever you want the search form to appear. Add any of the optional attributes below.
  4. Include the styles below in your stylesheet. Feel free to modify the styles as you see fit.

Plugin Attributes

max
The maximum number of live search results returned.
Default: “20”
Example: max=“10”

label
The label that appears next to the search input.
Default: “LiveSearch: “
Example: label=“Type To Search: “

inputvalue
The text that appears in the search input field by default.
Default: “”
Example: inputvalue=“search the archives”

inputsize
The size of the search input field.
Default: “20”
Example: inputsize=“30”

showbutton
Determines whether a submit button appears on the live search form.
Default: “0”
Example: showbutton=“1”

buttonval
The text that appears on the search form submit button.
Default: “Submit”
Example: buttonval=“Go!”

searchto
By default the search form action will be your site home URL. If you want to post your form to a subdirectory, indicate so here. In the example below, the search would be posted to http://yoursite.com/search/?q=search+terms
Default: “”
Example: searchto=“search”

autocompleteoff
Adds autocmplete=“off” to the search input field. NOTE: This will not validate against the XHTML spec.
Default: “0”
Example: autocompleteoff=“1”

form
The article form used to display search results. Each search result will be rendered using the form and place inside a div as below.
<div class="LSRow">FORM CONTENT


Default: “”
Example: form=“live_search_article”

showsection
The article section will be displayed in a span following the article title.
Default: “0”
Example: showsection=“1”

showdate
The article post date will be displayed in a span following the article title (or date if applicable).
Default: “0”
Example: showdate=“1”

dateformat
Accepts strftime date format.
Default: “%B %d, %Y”
Example: dateformat=”%B/%d/%Y”

excerpts
Determines whether search results excerpts below article titles as on a normal Textpattern search.
Default: “0”
Example: excerpts=“1”

notfound
The message displayed when no search results are found.
Default: “No Results Found.”
Example: notfound=“Nothing to see here.”

Example Styles

#LSResult { position: absolute; background-color: #fff; width: 350px; }

#LSShadow { padding: 5px; }

#LSRes { background-color: #fff; }

.LSRow { padding: 0 5px; }

#LSHighlight { background-color: #aaa; }

#LSHeader { padding: 2px 2px 8px; }

.lsDate { display: block; color: #555; }

Textpattern Solutions

Textpattern Solutions

Textpattern Solutions is the first book published on Textpattern.

details at friends of ED or the official book website.

buy it at amazon.com