Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Multiple Add Templates

Quote Reply
Multiple Add Templates
Hello,

I have multiple add templates in my Links 2.0 system that depending on the category the user uses add.cgi in, they are called.

How do I set this up for Links SQL?

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


Quote Reply
Re: Multiple Add Templates In reply to
You'll want to edit add.cgi and pass in the category name as one of the tags to site_html_add_form. Then in HTML_Templates.pm, something like:

if ($name =~ /somecat/) {
$tpl = 'add_somecat.html';
}
elsif ($name =~ /anothercat/) {
$tpl = 'add_anothercat.html';
}
..

and then pass to load_template $tpl.

Hope that helps,

Alex

if