Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: Hiding main categories on home page: Edit Log

Here is the list of edits for this post
Hiding main categories on home page
There's been a few discussions here before about this but they are slightly different to my problem so I've created a new thread:

We have 16 main categories on our site, and we are in the process of redesigning it so that we can display a 4 x 4 listing of category icons on the home page. Previously we excluded two categories (a glossary and a test category) from being displayed via template edits in subcategory.html. We can't do this with a 4 x 4 layout as the missing categories produce gaps in the tables. This was not an issue in the previous 2 column layout but 4 columns from 18 categories is not an even split Wink.

As a rough solution I have created two dummy categories to even up the gaps i.e. each column now includes an empty cell. We already exclude the glossary and testing categories from searches via modifications to the search box HTML so that's not an issue. The only hacking I've needed to do is to edit Links/Tools.pm and do the following (new code in red) to exclude these dummy and unused categories from the category dropdown lists:

Code:

sub category_list {
# -------------------------------------------------------------------
# Return a list of all the categories.
#
my %ret;
my $cat = $DB->table('Category');
my @ids = $IN->param('CatLinks.CategoryID');
@ids = $IN->param('ID') unless @ids;
if ($CFG->{db_gen_category_list}) {
$cat->select_options('WHERE ID!=30 AND ID!=31 AND ID!=26 AND ID!=24 ORDER BY Full_Name');

I don't like editing the core code but I thought this was the quickest and simplest solution. Any opinions or comments on this are welcome though in case I haven't thought this through Wink.

Last edited by:

aus_dave: Jun 5, 2008, 7:31 PM

Edit Log: