Gossamer Forum
Home : Products : Gossamer Links : Discussions :

page.cgi? Can I split my links db?

Quote Reply
page.cgi? Can I split my links db?
Hi

Thanks for the pointers yesterday. I now have a mock-up which looks promising.

My next challenge is to get Links SQL to present the categories in a unconventional manner.

There is one category (call it X) of links which I have been asked to present separately from other categories.

What I plan to do is modify 'sidebar.txt' (simlar to header.txt but the menu is vertical) so it includes a link to category X but I also need to change 'category' so it doesn't include X.

Does this make sense? Is it sensible? Is it possible? If so, how do I go about making the changes?

Regards
Chris

Quote Reply
Re: page.cgi? Can I split my links db? In reply to
Without seeing what was done before, wrapping "X" in an <%if%> block, would proabably do it. If your <%if%> didn't meet the criteria for displaying X, don't display it.

PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Plugins:http://LinkSQL.com/plugin
Quote Reply
Re: page.cgi? Can I split my links db? In reply to
Since my original e-mail the picture has changed slightly. Not only do I need to treat one of the categories individually, I also need to present the categories in a specific (non-alpha) order.Furthermore the main page should also list sub-categories beneath each category.

The sidebar menu also needs to include links to the 'submit a resource' for 4 top-level categories. A registered user will still have to login, but is it possible to initiate a login from the main page which results in the correct option being selected from a selection list in the 'Add a Resource' form?

In order to exclude a specific category I imagine I need to set up a Template Global, select the categories, then use Links::SiteHTML::display for each record that satisfies the condition of the <%if%> block.

To have a bit more flexibility with the ordering I have added a field called 'ordinal' to the category table which I'll sort by in the above Template Global.

I need select records where the father ID is equal to the category ID. My first thought is to set up another Template Global but I'd like to know of alternative approaches.

Regards

Quote Reply
Re: page.cgi? Can I split my links db? In reply to
I'm not sure what you are doing here, in fact after reading the message twice, I'm twice as confused <G>

Sometimes, if you back up a step, you'll see that the solution is easier going in, rather than trying to back out.

When you are doing this, think about what links are being sent to your template in the %loop...% variable. In each of those records (links, categories) you can read each field, and then either process, or not process basedon the value in that field.

So, if you send a list of categories to print out, and you don't want to list certain categories, then you would generate a template global that contained the categories you wanted excluded, or included, then compare to it. It would be better than trying to walk the tree for each "item"

What this means, is if you have an "Adult" category, with 30 sub categories, find each of those subcategories, put them into a list, then use that list to check the "ID" or "FatherID" of a category.

Is this getting close?

PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Plugins:http://LinkSQL.com/plugin
Quote Reply
Re: page.cgi? Can I split my links db? In reply to
I'm confused too so we might be talking about different topics here :)

In essence I am porting a service that was implimented using PHP and miniSQL. Have a look at http://physicsweb.org/resources/

I need to replicate the behaviour of the current system and I'm hoping links SQL will cut out a lot of coding.

The main page lists most of the categories (the sub-categories of each category are listed beneath the
cat_title as un-ordered list items).

One of the main categories is to be excluded from the main template but a link to it needs to be set up in a sidebar.

I need to think mull things over before I can say if this is getting close ... all will become clear to me in (not too much) time.

Thanks

Chris


Quote Reply
Re: page.cgi? Can I split my links db? In reply to
Hi,

You may want to install the YahooSubCat plugin, that will handle listing the subcategories automatically.

Cheers,

Alex

--
Gossamer Threads Inc.