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;
i installed it, am currently using theme 3K2 which is a bulid of r310 of K2.
my search was broken before, and now it is actually working, however, it doesn’t display results in the sidebar or seem to work the way this mod is supposed to.. i’m not very technical, so i’m wondering if i messed up the directions
Very nice, thx.
Good blog