Hello,

Is there a way to skip some keys of the hash if not needed if using
HTML::Template? Imagine a hash with 10 keys - always printing out some
hidden stuff or using 10 different hashes with redundant information
isn't very well programmed...

I use this hash to represent some informations regarding some
documents
$template->param(documents => [
{ name => 'doc1', filename => 'fbackup.doc' ,         id => '12345' },
{ name => 'doc2', filename => 'vabuscopy_dutton.ppt', id => '23456' },
{ name => 'doc3', filename => 'sap_nt_instLAB.pdf',   id => '34567' },
{ name => 'doc4', filename => 'reducefs.txt',         id => '45678' },
{ name => 'doc5', filename => 'image12.gif',          id => '56789' },
]);
In the html template I use
<TMPL_LOOP NAME="documents">
  <H3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="#<TMPL_VAR NAME="name">">&bull;
      <TMPL_VAR NAME="filename"><!-- Hidden ID: <TMPL_VAR NAME="id"> -->
    </a>
  </H3>
</TMPL_LOOP>

As you can see I hide the ID in an html comment. If the ID is not used
the script gets unuseable. ErrorMessage: "'id' - this parameter name
doesn't match any declarations in the template file"


-- 
Best regards,
 Vince                          mailto:[EMAIL PROTECTED]



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to