Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Different "Add Listing" form

Quote Reply
Different "Add Listing" form
How can I serve different "Add Listing" forms based on the category.

For example, one category has books and hence I will need different info compared to other categories where there is a listing of programmers.

Does anyone know how to do this?
Quote Reply
Re: [TRPN] Different "Add Listing" form In reply to
If you still need an answer to this, here is how I did it. In a new folder in your template directory (say "books") Copy your "add files" add.cgi, add_error.cgi, add_success.cgi, your header.txt, footer.txt and menu.txt. Build a new form calling your different links fields. To call this form use: add.cgi?t=books. You will need to change your menu links linking say "add Books" with "full url to admin/add.cgi?t=books". You will also need to change your modform.txt. Here is how did it for the variables first first name and last name:
<%if First_Name%>
<tr>
<td align="right" valign="top">
<%body_font%>
First Name:&nbsp;&nbsp;</td>
<td valign="top">
<input name="First_Name" value="<%if First_Name%><%First_Name%><%endif%>" size="30">
</td>
</tr><%endif%><%if First_Name%>
<tr>
<td align="right" valign="top">
<%body_font%>
Last Name:&nbsp;&nbsp;</td>
<td valign="top">
<input name="Last_Name" value="<%if Last_Name%><%Last_Name%><%endif%>" size="30">
</td>
</tr><%endif%>

That way only the fields that are supposed to appear, appear. I used <%if First_Name%> to call all the fields in the alternate form, since <%if First_Name%> is a required field, so anyone modifying their, in my case listing (with contact info incl address, phone numbers etc) would see the form that matches their info.

hope that helps

Lennie