Template talk:HABS2
From Wikipedia, the free encyclopedia
This is a compressed version of Template:HABS. It's arguments are as follows: US state abbreviation (lowercase) | first 2 digits of the directory id number (look in the URL) | rest of the directory id number | first letter of the type of image(either "p" or "c") | rest of the type of image (either "otos" or "olor", respectively) | record page number (which page of the list of images is the image on) (numbered from zero) | caption page number (numbered from zero)
I found that I could generate the URLs with a few pieces of information, rather than entering all of it at once. This template uses these tricks. Here is how it works.
The "ImageURL" is a standard address which is then divided by state, by the first 2 digits of some id number(and the state), then by the full id number(and the state) and then a directory based on the type of image(either "photos" or "color" AFAIK), which I divide into the first letter and the rest of the word so it can be used later, and finally the name of the image is a different id number, and the first letter of the type of image, and ".jpg". That deals with the imageURL. Don't worry, the other's are simpler.
The "RecordURL" is a cgi script that takes some fixed arguments, then the same directory structure id system as the "ImageURL" had, and some more fixed text, and which page of results to return(normally zero, but it had to be included for records with lots of images (Los Angeles city hall has more than 100). The displayType argument is interesting; if it is not given, then you can't view individual pictures. If it is given, the numbers between 0 and 5 give different results when you do click on the pictures. One seems to be a zoom utility(that didn't work). Hm.
The "CaptionURL" is pretty simple. It's the same as the "RecordURL", except without the "displayType" argument. It also requires a page number argument, since the page numbers are not likely to be the same.