Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Different add.cgi template for each service

Quote Reply
Different add.cgi template for each service
I would appreciate suggestions how would you imagine to add different add.cgi template for each service of the website?

The problem is, that each service can contain different fields and different templates...

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Different add.cgi template for each service In reply to
This is what I am doing to serve 5 different add listing form.

1) Create different include_form.html. One for each type you want and name it like include_form_listing_type_1.html, include_form_listing_type_2.html.. etc


2) Create a new ENUM table/field called Categorytype in Category properties and list all different types in select options.

3) In add.html use below code

<%if Categorytype eq 'type1'%><%include include_form_listing_type_1.html%>
<%elseif Categorytype eq 'type2'%><%include include_form_listing_type_2.html%> .......

so on till however many form you have.

<%endif%>

I am sure you and other experts can figure out many other easier ways, however I have been using above method, I hope it helps.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Different add.cgi template for each service In reply to
Not sure if this works as I supposed.
I need to look at the core code, to check this.

Will be back later.

Thanks for the idea, anyway!

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Different add.cgi template for each service In reply to
Hi,

Actually you cannot display categoy fields add.html page, however Andy had been a big help in solving the issue at http://www.gossamer-threads.com/...orum.cgi?post=287081

Hope this helps.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Different add.cgi template for each service In reply to
I think, I see how your solution works. Of course your solution works, but is not optimal from the viewpoint of database.
It seems that you create new fields into Links table, but not just for 1 service (as recommended) but for more services. However extending the database this way, is not correct (however works fine), because the result is an unoptimized, unnormalized database. Each service should have a separate table, where only those fields are listed, which belongs to the service.
In optimal case, you should have more Links tables, like Links_Service1, Links_Service2, etc...

I think, the problem is, that the add.cgi doesn't have a database input field, where you could pass your decision, into which database the add.cgi should add those filled input fields.
In my ideal case, I should have 1 Category table, and as much Links_ServiceN tables as much service I have.
Then I could manage more services from one LSQL installation.


Anyway thanks for your suggestion!
You helped me seeing the problem more clear.


I still await more suggestions...
There might be another solution which would fit my needs, but I might missed it until now...
Any more ideas?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...