Using Templates with ScoutPalDB

ScoutPalDB will use an “HTM” (“Hypertext Markup”) file named “spdbtemplate” as its formatting template, if that file exists in the same storage location as the database file. (For most users, this will be the root folder of the storage card.) When a template file is deleted from the database storage folder, ScoutPalDB will return to using its default built-in template.

You will find some sample pre-written templates stored in subfolders inside the storage card. Use the built in Pocket PC File Explorer to copy a custom template from the subfolder to the database folder:
  1. Tap Start / Programs / File Explorer.
  2. Tap the icon just under the “Start Flag”, top left of screen. This will pull down a menu of device folder locations.
  3. Tap “My Device” if you do not see your storage card listed in the pull-down menu. Then tap the “Storage Card”, “SD Card”, or “CF Card” folder icon, depending on how your Pocket PC names the external storage.
  4. The pre-configured template files can be found in folders that have names which briefly describe their function. For example, you may see a folder named “+$7, -2.5m”, which is an attempt to describe a template that will let you know when a book is priced $7 or better and its sales rank is better than 2,500,000.
  5. Tap on the template folder of your choice. (Rename/add to these folders as you wish.)
  6. Inside each folder will be file named spdbtemplate.
  7. Tap Menu / Edit / Copy, or tap and hold the stylus on the spdbtemplate file and select “Copy”.
  8. Tap “UP” (bottom left) to navigate back to the root SD card folder.
  9. Tap Menu / Edit / Paste, or tap and hold in the empty space below the file list and select “Paste”. A copy of the template file will now be in the database folder.
  10. Start ScoutPalDB, then tap Settings/OK, and ScoutPalDB will use the template file.
  11. To stop using a template, simply use File Explorer to delete it from the database folder.
  12. It is important to always tap Settings/OK in ScoutPalDB after changing or deleting the template file, so that the program will recognize the change.
If you have some basic knowledge of HTML and JavaScript, you will be able to customize the sample templates. Even if you don’t know JavaScript, you will probably be able to figure out how to make minor “tweaks” to the template logic or formatting. A Google search for “HTML reference” and/or “JavaScript tutorial” or similar will yield a wealth of tutorials and references.

To modify a template, copy it to your computer and open it in Windows Notepad or WordPad, or a similar plain-text editor. (Don’t use Microsoft Word or some other “word processing” type of editor.) After editing and saving the template, create a new folder on the Pocket PC (so that you don’t overwrite the original template) and put a copy of your creation in the new folder. Then follow the instructions above to try it out. No harm will be done if your newly-created template has errors, it just may not work the way you intended it to after testing, and then you will need to correct the display or logic errors.

There is a hidden function in ScoutPalDB that is useful for testing template changes: Tap in “X42” instead of an ISBN, then tap “Seek”. ScoutPalDB will begin returning random database entries each time you tap Seek or press the Enter key. This will provide sample data to your new template so you can see it in action against a wide range of listings. You can easily stop this “test” mode of operation by entering an ISBN instead of leaving it blank.

Additional templates can be downloaded from http://www.scoutpal.com/db/templatecenter