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

Alternate add template ?

Quote Reply
Alternate add template ?
Hi,
I'll be building 2 templates, one for regular submission and one for detailed submission.
How can I call the other template? Maybe an add.cgi and an add2.cgi?

Thanks,
Emilio
Quote Reply
Re: Alternate add template ? In reply to
If you are going to have the access on two different pages, or different links, then that would really be the simplest way to do it.

Use add.cgi for the regular additions, and add2.cgi or add_detail.cgi for the other.

Only the templates would need to change. You'd need a set of templates to handle the additional fields.

------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/










[This message has been edited by pugdog (edited February 08, 2000).]
Quote Reply
Re: Alternate add template ? In reply to
But where do I tell add2.cgi to use add2.html as a template?
Quote Reply
Re: Alternate add template ? In reply to
I would have to look through the files -- which I don't have handy at the moment -- for any mention of add.html. If it's in your new add2.cgi file, rename it to add2.html. If it's in a different file, copy the subroutine that contains add.html to an add2.html subroutine and work backward from there...

Sort of the trial and error sleuthing method. Wink

Dan
Quote Reply
Re: Alternate add template ? In reply to
Any suggestion?
Quote Reply
Re: Alternate add template ? In reply to
Hi,

I don't know in which file is the reference to add.html ... maybe Alex or Pugdog could help here...

Thanks,
Emilio
Quote Reply
Re: Alternate add template ? In reply to
Look in HTML_Templates.pm

sub site_html_add_form {

That the routine that calls for add.html.

You might find it easier to do the following though:

When ever you want the detail add stuff to come up call add.cgi?add_detail=1

Then in your add.html template use this code:


<%if add_detail%>
Whatever you want to put in here.
<%endif%>

and/or

<%ifnot add_detail%>
Whatever you want in here
<%endif%>

Hope that helps. I've found it very useful for getting several different looking forms from the same template.

You can see what I did with the search templates here.

http://www.nmculturenet.org/cgi-bin/webman/search.cgi?db=Artisans

When you get there just select a different directory and search. You don't need to fill in a search term. (It'd probably crash if you did - but that's a different topic.)

Peace.

Kyle