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

Help: Filter per category / Link attributes per Category

Quote Reply
Help: Filter per category / Link attributes per Category
Hi,

I wanted to ask if somebody did something like that or has an idea how to do it.
I want to add features zu Links which depend on Categories and do this in seperate tables.

e.g.

Links Table as installed

add:

Category alcoholic drinks attributes per Link
-percentage
-color
-some more

Category non alcoholic drinks attributes per Link
-sirup / juice
-country of origin

I think the task is to make it searchable with the search fild and also make it possible to filter a search within a category for percentage.

Thanks for any help

n || i || k || o
Quote Reply
Re: [el noe] Help: Filter per category / Link attributes per Category In reply to
Goto: Database -> Editor -> Links -> Properties (Hit GO) -> scroll down and goto Add Column.

You should be able to add whatever fields that you wish like: isAlcoholic - type Enum - values Yes No --- etc...

and maybe new fields for percentage, color, etc...

Hope this helps,

- Jonathan
Quote Reply
Re: [jdgamble] Help: Filter per category / Link attributes per Category In reply to
Hi jdgamble and thank you for your reply.

Maybe I did not express my plan properly. The point is not that I want to add fields to the Links Table but add related tables per Category where the content is searchable and where you can refine the search within one Category with a filter.


This would be like:

Code:

Links ---------------
|
|
|
Properties of Cat1-------Properties of Links in Cat2
|
|
|
Properties of Links in Cat3

It should be somewhat like the relations which are possible to create with DBManSQL

Regards

n||i||k||o
Quote Reply
Re: [jdgamble] Help: Filter per category / Link attributes per Category In reply to
Ok,
I guess there is another approach. It would be easier to add only one table with the fields

ID - LinkID - CategoryID - AttributeName - AttributeValue

which would make it possible to restrict attributes to categories.
But is it possible to make this table searchable with a regular query?

Regards

n||i||k||o
Quote Reply
Re: [el noe] Help: Filter per category / Link attributes per Category In reply to
I don't believe there is a way to search other tables, right now, using regular search.cgi (search.pm). That is why your best bet would be to add extra fields to the links db for both scenarios. You could add a global that you could call from your search template to also search these fields, but the results would be separate.

- Jonathan