I have a db with info about files: filename, author, etc.

I read the info, pump it into an array of hashes. (named @filesinfo).

My display page shows the directory, then a filename and associated info,
then another mention of that same directory, then another file, etc.

I want to mention the directory once, then the list of files within that
directory,
then say the next directory followed by its list of files, etc.

I've tried playing around with a hash named %seen, adding the directory
names
as keys, and displaying the directory unless the key is found in seen, but
can't
quite get the syntax right, or something.

Here's the code I have so far:

  <table border=0 width="100%">

    [% FOREACH line = filesinfo %]

    <tr bgcolor="#DDCAFF">
      <td valign="top" colspan='2' bgcolor="#42ABC5" background
="/img/bg_lines_light.gif">[% line.path %]</td>
    </tr>

    <tr bgcolor="#DDCAFF">
      <td valign="top" colspan='2'><a href = "/tt2/docmgr/editdocs?pathid
=[% line.pathid %]"><img src="/img/OSE-EditTXT.ico" width=16 height=15
border=0></a> Title: <a href="[% http_ip_base %]/[% line.path %]/[%
line.filename %]" TARGET="_blank">[% line.title %]</a></td>
    </tr>
    <tr bgcolor="#eee9ff">
      <td valign="top">Author:   [% line.author %]</td>
      [% SET publish = 'Internal Use Only' IF line.audience == 'INT' %]
      [% SET publish = 'To Be Published' IF line.audience == 'EXT' %]
      <td valign="top">[% publish %]</td>
    </tr>
    <tr bgcolor="#eee9ff">
      <td valign="top" colspan='2'>Summary: [% line.blurb %]</td>
    </tr>

    [% END %]

    </table>

Thanks much,

/dennis




_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to