Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to: I have 4 categories with 4 diferent link types?

Quote Reply
How to: I have 4 categories with 4 diferent link types?
Here's my question...I have four different categories and each category requires different link characteristics or has different fields. For example, one category are job descriptions with 6-7 different columns or pieces of information. The 2nd category are resumes and they each have 6-7 different columns or pieces of information, the third category is a company profile/yellowbook listing page, and the 4th is just Other resources.

Each category requires a different form to fill out. What is the best way to do this?

1. Install Links in seperate folders. For example install Links in ...cgi-bin/jobs and ...cgi-bin/resumes and cgi-bin/company_profile, and cgi-bin/other.

2. Use some kinf of If statement? If "category jobs" <%include_form_jobs%> I'm not sure if this is possible?

3. Create different link types to be chosen on the add.html template and use an if statement similar to above...If link_type=jobs <%inlcude_form_jobs%>

Any insight here would be very helpful. If I am close with one of the above options please provide details so I can implement.

Thanks in advance.
Quote Reply
Re: [yobo] How to: I have 4 categories with 4 diferent link types? In reply to
1) The downside to this is that it requires a license for each installation.
2) This is the method that most people use. As long as you pass in the category type or ID in, then you can show the proper include_form.

You will probably need to write a custom plugin to handle field validation, since you can't rely on the built in mechanisms to work - all the columns will be added to one table and you won't be able to put certain restrictions on the columns because they won't be present in certain categories. You won't need this if all that information is optional.

Adrian
Quote Reply
Re: [brewt] How to: I have 4 categories with 4 diferent link types? In reply to
Tried the second option without success. I couldn't seem to get the "if statement" correct.

Also I believe it may not work because not only will there be parent categories but all the categories will have sub categories and I am not sure you can write an if statement for just the mother category and still ahve it work for the sub categories.

I do know that if you create different user types than you can do if statements for the different include_forms, but even then if you ahve two user types and four different include_forms to use things seem to get tricky.

Seems the easiest way is to just install glinks into four different fields. Do you really have to pay for additional licenses if it is the same website/domain? Doesn't seem to make sense, but I haven't read the licese sheet in a long time.