12 June 1999. The SRE-http replacement strings file. I. Introduction I.a The replacement strings file I.a.1 Specifying host specific replacements I.a.2 Note on multi-line replacements I.a.3 Providing arguments to custom replacement strings I.a.4 Notes ---------------------------------------- I. Introduction SRE-https REPSTRGS.IN file is used to specify "replacement strings" for use with the server side include. Note that replacement strings can also be specified in the ATTRIBS.CFG file (see IN_FILES.DOC for the details). ---------------------------------------- I.a) Replacement strings file (REPSTRGS.IN) The replacement strings file contains "custom" replacement strings that can be used by the REPLACE keyphrase. Each line of this file (except lines beginning with a semi-colon, which are treated as comments) has two fields: @ A variable_name . The variable_name can be any length, but must have NO embedded spaces. @ A REPLACEMENT STRING . The REPLACEMENT STRING is the string to be used when a REPLACE keyphrase with an argument of variable_name is found. Example: CONTACT CONTACT ME SOON! # CONTACT is the variable_name # CONTACT ME SOON! is the REPLACEMENT STRING # When a That is, do NOT include the .host_nickname in the SSI keyphrase. Note that when finding a replacement string, "superceding hosts" and "strict-superceding hosts" are treated the same as "non-superceding hosts". In other words, a host-specific value is used if it has been defined; otherwise, a non-host specific value will be used. Technical note: If you were to use in a document in the default (the non-host specific) data directory, then "Contact me (the lake master) soon" would be inserted. I.a.2) Note on multi-line replacements The REPLACE keyphrase can be used for multi-line replacements (note that for replacements of more then a few lines it is probably wiser to use the INCLUDE keyphrase). To specify a multi line replacement, just enter multiple occurences of the same label -- the values will be appended. Example: # MYADDRESS
My address is:
# MYADDRESS 1800 M St NW
# MYADDRESS Washington, DC
would generate 3 lines (when a keyphrase is encountered). I.a.3) Providing arguments to custom replacement strings You can provide arguments in the REPLACE KEYPHRASE that will be substituted into the replacement string. These arguments should follow the varname, with each ôURL encodedõ word being an argument. For example: @ the argument is MYFILE1. @ the first argument is PARENTS and the second argument is SECOND+GRADE. Note that the + will be converted to a space before being substituted into the replacement string. To be substituted, the replacment string should contain %N substrings, where n is an integer. For example: @ ODOM The first argument would replace the %1. Thus, would yield: ... a fairly simple way of invoking a graphical hit counter. ôThis ODOM replacement string is included in the default REPSTRGS.IN fileõ @ GREETINGS A BIG HELLO TO %1 OF CHILDREN IN THE %2 Using would yield: A big hello to parents of children in the second grade. Note that a maximum of 9 arguments should be supplied. All unused %n substrings will be removed from the replacment string. Thus, if a %6 is included in the replacment string, and only 5 arguments are provided, the %6 is removed. I.a.4) Notes @ The replacement strings file is REPSTRGS.IN. You can change this by modifying the REPSTRGS_FILE variable in INITFILT.80. Note: you can also specify replacement strings in ATTRIBS.CFG. @ These replacement stringss are only checked if the variable_name does not match one of the "built in" variables. @ Replacement strings can contain other SSI keyphrases (which will processed recursively). @ Replacement strings can contain HTML elements. @ The variable_name can contain any printable character (including periods).