General Concept |
File matching sections allow specific html code to be inserted based on pattern matching.
Any matching script section must be followed by a single line identifying an external file. For example: /FILE_MATCHES_TD This is a sample valid external file: /*.mp3|*.ogg Special case: Insert No Code If the external file includes a match that contains the insert code "NO_CODE-DIRHTML", matching files won't use any code from the external file. This makes it possible to have a /NO_MATCH-DIRHTML section that is ignored for certain files. An example of when this might be useful is if /FILE_MATCHES_A is used for all files except certain types that need to use a /FILE_MATCHES_TD code insert. Example:
/*.txt|*.doc Special case: no matches If the external file contains /NO_MATCH-DIRHTML, filenames that have no matching code will use code from the /NO_MATCH-DIRHTML section. Example:
/NO_MATCH-DIRHTML File matches are not cumulative (e.g. if the matching.txt file has /*.* and /*.*, only the first html code will be used). Internally, file match specs are sorted alphabetically, so /a*.* would be before /b*.*, regardless of their position in the matching.txt file. Note: All /FILE_MATCH sections support
%%F, %%F_PATH, %%NO_EXT_FNAME% and %%RELATIVE_PATH variables.
|
Section | Description, Use |
/FILE_MATCHES_TD | Adds text to <td>'s that contain matching file links. The section must contain only an existing file name (e.g. file_matches.txt), and the external file must use the same flat-file format used by dirhtml scripts, with each potential file match preceded by /, and multiple matches separated by |. Example:
Code is inserted: /FILE_MATCHES_TD <td HERE> |
/FILE_MATCHES_A | Adds text to the <a> of matching file linksCode is inserted: <a HERE>...</a> |
/FILE_MATCHES_BEFORE_A | Adds text before matching file links (before the opening <a) Code is inserted: HERE<a>...</a> |
/FILE_MATCHES_INSIDE_A | Adds text before matching file links (before the link text) Code is inserted: <a>HERE...</a> |
/FILE_MATCHES_INSIDE_A_SUPPRESSED | Adds text in place of a filenames; The filename is not shown (e.g. suppressed) for any file with a match Code is inserted: <a>HERE</a> |
/FOLDER_MATCHES_TD | The same as /FILE_MATCHES_TD, but for links in the folder table |
/FOLDER_MATCHES_A | The same as /FILE_MATCHES_A, but for links in the folder table |
/FOLDER_MATCHES_BEFORE_A | The same as /FILE_MATCHES_BEFORE_A, but for links in the folder table |
/FOLDER_MATCHES_INSIDE_A | The same as /FILE_MATCHES_INSIDE_A, but for links in the folder table |
/ANCHOR_MATCHES_TD | The same as /FILE_MATCHES_TD, but for links in the anchor table |
/ANCHOR_MATCHES_A | The same as /FILE_MATCHES_A, but for links in the anchor table |
/ANCHOR_MATCHES_BEFORE_A | The same as /FILE_MATCHES_BEFORE_A, but for links in the anchor table |
/ANCHOR_MATCHES_AFTER_A | Adds text after links in the anchor table |
/ANCHOR_MATCHES_INSIDE_A | The same as /FILE_MATCHES_INSIDE_A, but for links in the anchor table |
/ANCHOR_ROW_MATCHES_TD | The same as /FILE_MATCHES_TD, but for anchor rows in the file table |
/ANCHOR_ROW_MATCHES_BEFORE_TEXT | Adds text before anchors in the file table Code is inserted: HERE This is an anchor row |
/ANCHOR_ROW_MATCHES_AFTER_TEXT | Adds text after anchors in the file table Code is inserted: This is an anchor row HERE Note: /ANCHOR_MATCHES_ROW... sections can use %%COLUMNS% variables Note: Folders are stored internally as /folder/sub-folder/, and lines starting with // are comments, so use wildcards to match an anchor.For example: /?folder/sub-folder/
|