Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Different fields, add/modify/search forms and templates for certain categories

Quote Reply
Different fields, add/modify/search forms and templates for certain categories
I want certain fields to be filled only when user is submitting a link to certain categories (3-5 categories). I know I could add all fields in the links table and use specific forms to display for those categories. Instead of adding all fields in the links table, is there a better way to do this by creating different tables for each of those categories and creating category specific fields in those tables? If so, then how would I display different add/modify forms and more importantly search forms (so only links from that category are displayed and not all results) and optionally if possible also use different templates for those 3-5 categories? Thanks!
Quote Reply
Re: [socrates] Different fields, add/modify/search forms and templates for certain categories In reply to
Hi,

I can't think of a better way I'm afraid. What I could do, is create all the fields in the Links table, and then based on the category they are adding to, load a different include_form.html template.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [socrates] Different fields, add/modify/search forms and templates for certain categories In reply to
If you use the add form from the cats itself you have the cat id;
witht he catid it is easy to say

if cat!=lala show form field.

Maybe you can use an array also, i dont know. Andy?

But with 3-5 catids it should be no big problem to ask

if catid = x else if catid = y else show form field.

The same it is with add_result.

If you use the add.cgi without an id, you will need some javascript, maybe?
A different add.html will bring nothing here, i think.