Gossamer Forum
Home : Products : Links 2.0 : Customization :

Different Add form for depending on category?

Quote Reply
Different Add form for depending on category?
Hello,

I was curous as to whether or not some one can help me. I need to be able to have a different add form for certain categories. So overall, I need multiple add forms.

Any suggestions. Smile


------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com
Quote Reply
Re: Different Add form for depending on category? In reply to
If someone could come out with an idea of doing this, please share it. I would like to know this as well.
Quote Reply
Re: Different Add form for depending on category? In reply to
James,

Try this link... I think it should help.
http://www.gossamer-threads.com/...um3/HTML/002252.html

Phoenix
Quote Reply
Re: Different Add form for depending on category? In reply to
No problem... You'd never have found that one using search unless you'd already read it. I just happened to remember that it used the term "add2.cgi" in the thread. No other search terms came up with it.

Phoenix
Quote Reply
Re: Different Add form for depending on category? In reply to
Phoenix,

Once again, thank you.

Smile Smile Smile Smile

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com
Quote Reply
Re: Different Add form for depending on category? In reply to
Actually, the thread is how to use a different add.cgi, not how to use different add templates, each with a different form. Since the form is based on categories, the Using Multiple Templates FAQ in the Resource Center would do the trick very nicely. See http://www.gossamer-threads.com/...es/Detailed/213.html

I hope this helps.

[This message has been edited by Bobsie (edited August 05, 1999).]
Quote Reply
Re: Different Add form for depending on category? In reply to
Bobsie,

Ok I iused the multiple categories mod and changed it around. What I'm doing is calling the following sub from add.cgi to go to the correct add form depending on the category:
Code:
sub site_html_add_get {
# --------------------------------------------------------
# This routine determines which Add form sub to use.
#
&html_print_headers;
my $template;

if ($category_name =~ "Teams/Novices") {
$template = "add-books.html"; }
else { $template = "add.html"; }

print &load_template ( $template, {
date => $date,
time => $time,
category => $category,
links => $links,
title_linked => $title_linked,
title => $title,
total => $total,
grand_total => $grand_total,
category_name => $category_name,
category_name_escaped => $category_name_escaped,
category_clean => $category_clean,
description => $description,
meta_name => $meta_name,
meta_keywords => $meta_keywords,
header => $header,
footer => $footer,
prev => $prev,
next => $next,
related => $related,
build_links_per_page => $build_links_per_page,
address => $address,
city => $city,
state => $state,
%globals
} );
}

It doesn't work. It brings up the regular add.htmll template and for the category it is suppoesed to hard code, I get this in that field:
Code:
Unknown Tag: Category

Any suggestions. Thanks in advance. Smile


------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com
Quote Reply
Re: Different Add form for depending on category? In reply to
Bobsie,

Do I need to call it $category_name_escaped?

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com
Quote Reply
Re: Different Add form for depending on category? In reply to
You are passing:

Quote:
category => $category,

but your template is looking for <%Category%>. The links tags are case sensitive so you should be using <%category%>.

Why it is not loading the proper template is the final question. Can you post the code that calls sub site_html_add_get in add.cgi or send me the add.cgi script so I can see it ( bobsie@orphanage.com )?
Quote Reply
Re: Different Add form for depending on category? In reply to
ok.

sent you email

Smile

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com
Quote Reply
Re: Different Add form for depending on category? In reply to
Was this one ever figured out?

I have the same need to go to different add.html templates depending on the category.

I'd rather use 1 add.cgi and multiple templates, rather than separate add2.cgi, add3.cgi, etc.

Here are some other threads about the same thing:

http://www.gossamer-threads.com/...ew=&sb=&vc=1

http://gossamer-threads.com/...pl?ubb=002252:Forum3

Many Thanks.