This script written by Mark creates an index file called artid2pg.idx which links DIV ids to page numbers and allows you to generate links to pages from DIV-level search results. art2object.pl comes in the goodies directory of Philologic. If you would also like to include page numbers next to KWIC results, please see KwicPageNumbers.
CookbookA brief description of how to get page numbers to display after headwords or other DIV-level object searches. Get art2object.plCopy mk_art2object.pl from the goodies directory of your Philologic install into the $SYSDIR (the install directory) for the database you are working on. For example: cp /var/lib/philologic/goodies/art2object.pl /var/lib/philologic/databases/mydictionary/ Run art2object.plExecute the script from within the $SYSDIR of your database like so: cd /var/lib/philologic/databases/mydictionary/ Modify DivDisplayLine in philosubs.plChange DivDisplayLine in philosubs.pl to look something like this: sub DivDisplayLine {
Add DivPageLink to philosubs.plAdd a new subroutine to philosubs.pl that looks like this: # ----------------------------------------------------------------------- Variant or Possible BugfixA new version of mk_art2object.pl was generated for use a project where it was noticed that the first two objects on each page were incorrectly being linked to the previous page. Here's a diff of the old script on the left and new script on the right: < $div = 0; These differences between this script and the stock one that comes with Philologic 3 are simple. First, we only increment $div when we see <div2, not just <div, because only <div2 signifies a new entry in DSAL dicos. Secondly, we start $div at -1 instead of 1, because the first object is index 0 and we incremement before writing out the index. Do all databases need that? We're not sure right now. |