Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

List all main/root categories in one file

Quote Reply
List all main/root categories in one file
The reason to do this, is that I will include (ssi) an updated main category listing in ONE column on every page.

Also, how can I list the latest x links on my frontpage, home.html. When using 2.0, it was rather simple, but how may I do it in sql? (Could it be select * from sometable
sort by desc, limit 30 or something??)

I have just gotten the links sql, so I donīknow much about how I use the select. Is there as simple as writing select sentences in template?)


Any help appriciated!

Thanks.

Are

Quote Reply
Re: List all main/root categories in one file In reply to
Hi,

Both will take a little programming. To do the main category listings, you'd basically want to print out:

print TOFILE &site_html_print_cat ($root_cat_r) if ($root_cat_r);

Look at sub html_home for more info.

As for pulling out the links, do:

my $links = $db->query ({ ID => *, sb => 'Add_Date', so => 'DESC', mh => 30 });
foreach my $link (@links) {
.. do something here.
}

Cheers,

Alex
Quote Reply
Re: List all main/root categories in one file In reply to
Hi Alex,

could it be the following:

When building <%category%> for category.html
there should be the same query as for home.html, then send it to a var named <%category_h%>; so now i should use this tag and get all the first-level-cats on every category-page.