These instructions are mainly for Movable Type users, but I have noted the changes necessary for other systems. Tony Williams is using Perlfect Search with Blosxom, as he wrote to the Blosxom list earlier today; as he's using static mode, it sounds like any weblog tool that bakes your pages will work. If you want search for your Radio UserLand weblog and can't set up Perlfect, these PicoSearch instructions by Russ Lipton still apply as far as I know.
If any of the below is unclear, my markpasc.src is here.
- Copy this file to your Mozilla
searchpluginsdirectory. Name itweblog.src, or some othername.src. (I usemarkpasc.src.) Open the file in your favorite text editor. - Replace the
name,description,action, andsearchFormattributes with the appropriate values for your weblog. Because Movable Type will display a helpful search page, MT users can use the same URL in both; otherwise,actionis the URL that receives the form data, andsearchFormis where you would send a web user to enter a query. - To limit your search to certain Movable Type weblogs, remove the
!--and--from theIncludeBlogstag, and set the value appropriately. Separate multiple values with a comma (eg,<input name="IncludeBlogs" value="2,3">). If you're using some other search tool and need to specify other standard options, set them ininputtags like theIncludeBlogsone (that is, withvalueattributes). - If you want your plugin to work in the Mozilla sidebar (which isn't so important for me as I'm using Phoenix), you have to set up your
interprettag. If you don't do anything, Mozilla will just list every off-site link in the search results, which is rather ugly if you show full entries in your results like I do.- Uncomment the
interprettag. - Look at your search template, or do a test search and look at the resulting HTML. Is it clear where your results begin and end? If so, put these strings in as the
resultListStartandresultListEndattributes. If not (and you're using Movable Type or some other system where you have this control), make something up--HTML comments like<!-- results -->and<!-- /results -->would be good--and add them to both your search plugin asresultListStartandresultListEndand to your search template. (In Movable Type, flank yourMTSearchResultstag with them.) Look at your template or example search again. Find the starting and ending codes for your entry titles. Is it obvious where your title is? It is if you're using proper semantically-charged HTML. My titles are
h3s withidattributes, so it's easy for me:<h3 id=and</h3>. If it isn't so easy, you can add comments as above.I tried to use
class="title"at first, but had to escape the double quotes as", and Mozilla didn't seem to catch what I meant. If you need to use double quotes in any of these result attributes, try putting the attribute in single quotes instead of double quotes. If you need both, you may need to break down and add an HTML comment as above.The search plugin needs to find not only your title, but a complete
a href, so make sure your title is a link. You can use CSS to make it not look as link-like; I like my title links to be the same color as the text, and only have an underline when moused over. The CSS rules for that would be:h3 a:link { color: black; text-decoration: none; }
h3 a:hover { color: black; text-decoration: underline; }with
h3andblackreplaced with whatever's appropriate for your template, of course.
- Uncomment the
- If you want to spiff it up in your UI, provide an icon. Make it 16×16 pixels and put it in the Mozilla/searchplugins directory with the same filename as your
.srcfile, but its regular.gifor.pngextension. (Hint, if your weblog doesn't have a logo, like mine: the little gear in the Movable Type logo is 14×15 pixels.) - Restart Mozilla and enjoy.
- If you're providing your search plugin to others and want to keep it updatable, uncomment the
browsertag as above. Upload your.srcfile and icon somewhere public, and put their URLs in theupdateandupdateIconattributes of thebrowsertag. - Look at the Mycroft documentation for a few more embellishments.