Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Dividing Category Listings with Headings according to field=x or y or z

Quote Reply
Dividing Category Listings with Headings according to field=x or y or z
I would like to have my category page laid out like this...

CATEGORY TITLE

Type of Resource

Link

Link

Type of Resource

Link

Link

Another Type of Resource

Link

Link

I have given my links a "what" field with the type of resource that it is, but since the links are called by <%links%> I cannot get them to be grouped together under one heading.

I have tried calling links like

<%if what eq 'type1%>
Type 1<br>
<%links%>
<%endif>
<%if what eq 'type2%>
Type 2<br>
<%links%>
<%endif>

but what I end up with is all the links still separate with their own little heading like

Type 1
Link

Type 2
Link

Type 1
Link

...etc.

Any ideas on how to get what I need? I thought maybe another type of <%links%> global would work so that I could display Type 1<%links_type1%>, Type2 <%links_type2%>, etc. but I was hoping to do this without any programming (which I don't know how to do).

Let me just say I am amazed at the capabilities of Links SQL these days. I started using Links way back when 2.0 was all there was, and I didn't expect much. However, I know there has to be a way to make this work. Any help would be appreciated. :)
Quote Reply
Re: [AtoZ] Dividing Category Listings with Headings according to field=x or y or z In reply to
This is for the benefit of any other poor souls who search the forum listings to find answers to their problems only to find dead end posts like this one. I found the solution....

('what' is the name of a column in my database for indicating the type of resource)

TYPE 1
<%loop links_loop%>
<%if what eq 'type1'%>
<%include link.html%>
<%endif%>
<%endloop%>
TYPE 2
<%loop links_loop%>
<%if what eq 'type2'%>
<%include link.html%>
<%endif%>
<%endloop%>
TYPE 3
<%loop links_loop%>
<%if what eq 'type3'%>
<%include link.html%>
<%endif%>
<%endloop%>

AND SO ON...

I have a new question regarding this loop feature in the following post.
How do I include listings with a field=something *AND* anotherfield=somethingelse??? HELP!
http://www.gossamer-threads.com/...i?post=203300#203300

Last edited by:

AtoZ: Jun 29, 2002, 2:22 PM