{"id":151,"date":"2006-03-05T17:02:44","date_gmt":"2006-03-05T22:02:44","guid":{"rendered":"http:\/\/www.glendathegood.com\/blog\/?p=151"},"modified":"2006-03-05T17:09:47","modified_gmt":"2006-03-05T22:09:47","slug":"i-dig-it-htdig-search-ssi","status":"publish","type":"post","link":"http:\/\/www.glendathegood.com\/blog\/i-dig-it-htdig-search-ssi\/","title":{"rendered":"I Dig It:  htdig search &#038; ssi"},"content":{"rendered":"<p>When it comes to usability and information architecture, there is just no replacement for a good search engine on your site.  Try as you might to design an intuitive navigation scheme, let&#8217;s face it&#8230;one size never fits all.  But no need to fear&#8230;your search engine can add an alternative way for folks to find what they so desparately seek.<\/p>\n<p>In my world (<a href=\"http:\/\/www.utexas.edu\/\">UT Austin<\/a>), I&#8217;ve got two obvious choices for search engines, <a href=\"http:\/\/www.google.com\/options\/universities.html\">Google Free University Search<\/a> and <a href=\"http:\/\/www.htdig.org\/\">htdig<\/a>.  While Google is sweet, I can&#8217;t customize the results page, so google doesn&#8217;t meet my needs.  So, I turn to my good ole friend, htdig.  But unlike other sites where I&#8217;ve implemented htdig, the site I&#8217;m working with now stretches across two different servers and is virtually hosted as well.  Creating the results page header and footer proved to be a challenge because (horrors), htdig wouldn&#8217;t let me use server side includes (ssi) .  Ouch!<\/p>\n<p>I toyed with the idea of writing the results page in PHP but was convinced that if I thought creatively enough, I could trick htdig into letting me use ssi.  And after a few bumps and bruises I won the battle.  So, in case you&#8217;ve got a yearnin&#8217; for ssi in your htdig results page, here is what I learned yesterday.<\/p>\n<p>Ingredients:<\/p>\n<ul>\n<li> plain ole html search form using get with the action set to a dynamic results page<\/li>\n<li>dynamic results page with a suffix of .html <\/li>\n<li> .htacess file instructing your server to parse .html for ssi<\/li>\n<li> and your usual header.html and footer.html <\/li>\n<\/ul>\n<p>1)  Set your search form vars as follows:<br \/>\n<code><br \/>\n&lt;form method=\"get\" action=\"results.html\"><br \/>\n&lt;input type=\"hidden\" name=\"config\" value=\"nameofyourconf\" \/><br \/>\n&lt;input type=\"hidden\" name=\"restrict\" value=\"\" \/><br \/>\n&lt;input type=\"hidden\" name=\"exclude\" value=\"\" \/><br \/>\n&lt;label for=\"words\" class=\"headline\">Search XYZ site:<br \/>\n&lt;input type=\"text\" size=\"30\" name=\"words\" id=\"words\" value=\"\" \/><br \/>\n&lt;input type=\"submit\" value=\"Search\" \/><br \/>\n&lt;\/form><br \/>\n<\/code><\/p>\n<p>Note:  the method is get and the action is pointing to your dynamic html results page.  <\/p>\n<p>2) dynamic results page &#8211; use<br \/>\n<code><br \/>\n&lt;!--#include virtual=\"foo.html\"--><br \/>\n<\/code> to dynamically bring in elements<\/p>\n<p>3)  create an .htaccess file that includes:<br \/>\n<code>AddType text\/html .html<br \/>\nAddHandler server-parsed .html<\/code><\/p>\n<p>4) Create your <a href=\"http:\/\/www.htdig.org\/FAQ.html#q4.2\">htdig custom header.html and footer.html <\/a>and set your conf (htdig config) to use these files. Just remember that you can <strong>not<\/strong> use ssi in these two files because htdig won&#8217;t process it&#8230;and htdig currently requires that these files be html files.  No shtml or php versions of the header or footer allowed!<\/p>\n<p>And for your coding pleasure, a <a href=\"http:\/\/glendathegood.com\/htdigssi\/\">working sample<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When it comes to usability and information architecture, there is just no replacement for a good search engine on your site.  Try as you might to design an intuitive navigation scheme, let&#8217;s face it&#8230;one size never fits all.  But no need to fear&#8230;your search engine can add an alternative way for folks to find what they so desparately seek.<\/p>\n<p>In my world (<a href=\"http:\/\/www.utexas.edu\/\">UT Austin<\/a>), I&#8217;ve got two obvious choices for search engines, <a href=\"http:\/\/www.google.com\/options\/universities.html\">Google Free University Search<\/a> and <a href=\"http:\/\/www.htdig.org\/\">htdig<\/a>.  While Google is sweet, I can&#8217;t customize the results page, so google doesn&#8217;t meet my needs.  So, I turn to my good ole friend, htdig.  But unlike other sites where I&#8217;ve implemented htdig, the site I&#8217;m working with now stretches across two different servers and is virtually hosted as well.  Creating the results page header and footer proved to be a challenge because (horrors), htdig wouldn&#8217;t let me use server side includes (ssi) .  Ouch!<\/p>\n<p>I toyed with the idea of writing the results page in PHP but was convinced that if I thought creatively enough, I could trick htdig into letting me use ssi.  And after a few bumps and bruises I won the battle.  So, in case you&#8217;ve got a yearnin&#8217; for ssi in your htdig results page, here is what I learned yesterday.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"http:\/\/www.glendathegood.com\/blog\/wp-json\/wp\/v2\/posts\/151"}],"collection":[{"href":"http:\/\/www.glendathegood.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.glendathegood.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.glendathegood.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.glendathegood.com\/blog\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":0,"href":"http:\/\/www.glendathegood.com\/blog\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.glendathegood.com\/blog\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.glendathegood.com\/blog\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.glendathegood.com\/blog\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}