Geeks With Blogs

Lance's TextBox

In part 1, I showed how to add Twitter Search to SharePoint using the RSSBus WebPartIn part 2, I added input properties to the script so that the web part was controlled by the properties in the property editor.  Now, I can hook this up with a regular input textbox to let the user drive the search.

Now my RSSBus WebPart script looks like this:
<rsb:info title="My Custom Search">   <input name="query" description="A default query" default="SharePoint" /> </rsb:info>  <div align="center" id="mySearchForm">   <input type=text name="query" size=40 value="" />   <button type="submit">Search</button> </div>  <table cellspacing="10px">   <rsb:call op="[[_request.form:query | def('[[query]]')]]">     <tr>       <td><A href="[[rss:link#1]]"> <img align="left" src="[[rss:link#2]]" border="0" width="43px"/></td>       <td>[[atom:author_name]]</A>: [[rss:description]]</td>     </tr>   </rsb:call> </table>

I added my text input and submit button.  I changed the Twitter search url to get the query input from the request objects’ “query” form variable, and if there is nothing there, it will default to the “query” input defined in the rsb:info (thats what the | def(‘’) is for).

Now I click “Apply” and when the RSSBus WebPart reloads it will contain the textbox and search button.  When the user first browses to the page on which the webpart is placed, it will display the search results for “SharePoint”, since I set that as the default in the rsb:info.  They can type in whatever search term(s) they like and click “Search” to change the results.

Technorati Tags: ,
Posted on Thursday, April 23, 2009 1:45 PM | Back to top

Comments on this post: Tweets in SharePoint – Part 3

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Lance Robinson | Powered by: