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!
Oct 1, 2017, 10:21 PM
Veteran / Moderator (18436 posts)
Oct 1, 2017, 10:21 PM
Post #2 of 3
Views: 3413
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!
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!
Oct 2, 2017, 10:30 AM
Enthusiast (901 posts)
Oct 2, 2017, 10:30 AM
Post #3 of 3
Views: 3395
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.
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.