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

How to Build Categories based on a specific condition?

Quote Reply
How to Build Categories based on a specific condition?
I've modified my Links table and added a new field. It's purpose is to identify a record as either a link or a file. in the search results I solved my problem just adding a field to search.cgi to limit my searches to records with an specific value, the problem I have is when building Categories, links that are build in the categories can NOT be easily excluded, as in a search. I would like, for example to make a call to the <%links%> tag and specifically request records with a specific field. is this possible? I was thinking on modding links to allow me to do something like <%links($type)%>

Thanks,

Last edited by:

jaltuve: Mar 13, 2003, 6:23 PM
Quote Reply
Re: [jaltuve] How to Build Categories based on a specific condition? In reply to
If you are using the 'link_loop' loop, then you can do this quite easily.

In category.html, use a loop:
Code:
<%loop links_loop%>
<%if type eq 'type_to_be_excluded'%><%nextloop%><%endif%>
<%include link.html%>
<%endloop%>

The only problem with this solution is that it will mess up the number of links on a page, i.e. if you usually display ten links per page, and two of them are excluded, then only eight will be displayed. If you don't want this, then the solution becomes more complicated, and you'd definitely need a plugin.

I hope that helps.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [jaltuve] How to Build Categories based on a specific condition? In reply to
Following on from the reply above, if you added the custom field as the first field in the list to sort the category by, then you could put all the links first and have the 'hidden' links at the end of the list. Then you would just need to write a global to get the span pages to work correctly for the number of links you are actually showing.

Laura.
The UK High Street