This mod is no longer supported. Live Search in the current K2 svn works great.
This is a modification of the Live Search functionality found in K2 from svn and the nightly builds. I’m currently using this mod with my site. For a demonstration, just type something in the search field. This mod will not work in K2 Beta Two r167. If Live Search and/or Rolling Archives currently do not work with your site, then this mod most likely will not work.
Features:
- Search results shown in the sidebar.
- Works without the need of the built-in Rolling Archives. Yay!
- Button to clear the search results.
Installation Instructions:
- Make a backup of the following files:
- livesearch.php
- searchform.php
- js/livesearch.js.php
- Download live-search-1.0.zip.
- Copy livesearch.php and searchform.php into the k2 folder, replacing the existing files.
- Copy livesearch.js.php into the js subfolder, replacing the existing file.
- Copy search-more.gif and search-reset.gif into your scheme’s images folder.
- Add the following to your scheme’s stylesheet:
- /* Live Search */
- #live-results {
- padding: 10px;
- }
- #live-results h2 {
- display: block;
- font-weight: bold;
- }
- #live-results h3 {
- font-weight: normal;
- }
- #live-results h3 a:hover {
- color: #27d;
- }
- #live-results .chronodata {
- display: block;
- margin-bottom: 0.5em;
- color: #666;
- }
- #live-results .more-results {
- display: block;
- font-weight: bold;
- margin: 1em 15px 0px 0px;
- padding: 2px 0px 2px 20px ;
- background: url('images/search-more.gif') left center no-repeat;
- }
- #searchinput, #searchinput.livesearch {
- width: 150px;
- }
- #search-loading {
- float: right;
- height: 18px;
- width: 18px;
- background: url('../../images/spinner.gif') center center no-repeat;
- }
- #search-reset {
- margin-left: 10px;
- height: 18px;
- width: 16px;
- background: url('images/search-reset.gif') center center no-repeat;
- cursor: pointer;
- }
- /* Sidebar RSS icon fix */
- .feedlink img {
- float: right;
- position: static;
- }
Download: live-search-css.txt
Notes:
If you’re applying the stylesheet additions directly to the default style.css then change the background tag for #search-loading to: background: url('images/spinner.gif') center center no-repeat;
<p>Will this work in a widget?</p>
<p>Probably with some hacking.</p>
<p>The Live Search Mod seems to jumble up on the side</p>
<p>Nice job..works great. THanks,</p>
<p>Great work !!!</p>
<p>To make spinner.gif happy i think have to change</p>
<p>(’../../images/spinner.gif’)</p>
<p>to</p>
<p>(‘images/spinner.gif’)</p>
<p>Cheers
</p>
Spinner aka Mads
<p>Great job Steve!
will try it out later today</p>
<p>wondeful!
just what i need!
thank u!!</p>
<p>I definately cannot create a working widget. I’m afraid you will have to widgetize this great hack.</p>
Somehow I cannot get it to work, the text ‘search blog archives’ won’t go away automatically and the livesearch functionality doesn’t work at all… what could be wrong?