home  NETCONSOLE  : Site Search 

NetConsole: Site Search Package

The Site Search utility is a powerful tool for webmasters. If you have a site with a large amount of text information on it, you will find Site Search to be an invaluable package, as it allows users to navigate your site easily.

Highlights

Installing Site Search

To install the Site Search package, first log into your NetConsole and click on the "Package Installation" section. From the package installation page select, "search" from the list of available packages and click the Install button. On the following page, you will be prompted for a directory in which to install the package. Enter the desired directory and click the "Install search now" button. If the directory does not exist, it will be created for you.

Using the Site Search Package

Once the search package has been installed, searches may be performed by visiting: http://yourdomainname/searchdirectory/index.phtml

Configuring Site Search

When the site search package is installed, the following files are dropped into the directory you specify during installation:

Editing index.phtml

This is the site search page. You may modify it to match the look of your site, however be sure to keep the ".phtml" extension intact.

We have provided screenshots demonstrating how to edit index.phtml using Macromedia's Dreamweaver.

Modifying results, appearance of next and back buttons (pager):

Number of Results Per Page

The number of results per page is specified on line 19 of the default index.phtml file:

You may change this line to suit your preference, the default number of results returned is 10.

Result Appearance

The standard layout for a result is:

24 <div class="result">
25	<div class="result_title"><a href="{url}"><span field="title">PAGE TITLE</span></a></div>
26	<div class="result_description"><span field="description">RESULT DESCRIPTION</span></div>

27	<div class="result_summary"><span field="summary">RESULT SUMMARY</span></div>
28	<div class="result_info"> /<span field="filename">FILENAME</span>
29	<br />score: <span field="score">SCORE</span></div>

30 </div>

You may change this as you wish. For example, if you wanted to prevent the score from appearing, simply remove line 29:

You may also re-arrange the order of these elements, and where they appear.

It is important to note that the items do not have to be in divs or spans. You may use p tags instead. The texts in this default installation example, such as PAGE TITLE, RESULT DESCRIPTION, FILENAME, etc. are placeholders provided to help you when you edit the .phtml file to suit your layout needs. The text itself is replaced when you view it via the browser.

Pager Appearance and Behavior

Lines 31-34 of the default index.phtml file contain the specifications for the appearance of the pager buttons:

31 <pager> <a page="previous">Previous</a> 
32 Page: #page# of #pages# 
33 <A page="next">Next</a> 

34 </pager>

You are free to modify these lines to change pager appearance and behavior. For example, you may add a class attribute to the a tags, and change the look and feel via css. You may also replace the anchor text ("Previous", in this example) with an image or other text. What you should leave are the main <page> tags, the page="next" and page="previous" attributes on the links (a tags) and the #page# and #pages# placeholders.

default.css

This is the default stylesheet for index.phtml.

Updating the Search Engine Index

If you manipulate the files on your site through FTP* or Microsoft FrontPage, you won't ever have to manually update the Site Search index. However if you create or delete any of your web pages through your account's shell interface or some other method, the index will have to be updated manually.

To manually update the index for your Site Search package, connect to your account via SSH and run the indexd program:

bash-2.04$ indexd
 

* Many popular HTML authoring programs with built-in uploading/publishing features, such as Macromedia's Dreamweaver, use FTP for transferring files.

Related Items

Email and Web Hosting by Internet Connection 2004-2009 ©
Contact Us