Augusto Flavio wrote:
: The problem is my array... Look:
:
:
: @domains = (
: { name => 'domain1.com'},
: { name => 'domain2.com'},
: { name => 'domain3.com'},
: );
:
: where i place the subdomain of the value domain2.com ?
@domains = (
{ name => 'domain1.com'},
{ name => 'domain2.com',
subdomain => 'www.domain2.com',
},
{ name => 'domain3.com'},
);
And in the template add a variable for sub domain in
the appropriate spot. You may need to turn off
"die_on_bad_params" when you initialize the template.
<tmpl_if subdomain>
<tmpl_var subdomain>
</tmpl_if>
A more robust solution would allow for multiple sub domains.
Use this and an inner loop named "subdomains". The "if" part
may not be necessary. You'll need to test it.
@domains = (
{ name => 'domain1.com'},
{ name => 'domain2.com',
subdomains => [
{ name => 'www.domain2.com' },
{ name => 'foo.domain2.com' },
{ name => 'bar.domain2.com' },
],
},
{ name => 'domain3.com'},
);
And in the template something like this.
<tmpl_if subdomains>
<tmpl_loop subdomains>
<tmpl_var name>
</tmpl_loop>
</tmpl_if>
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>