Gossamer Forum
Quote Reply
don't display category
is there a way so that i can display all of the categories but certain ones. also is there a way to display all subcategories of a certain category but not the root categories?
-grerg
Quote Reply
Re: [Gregorio] don't display category In reply to
an unless statement should do..

<%unless Category_Name eq soandso%>
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] don't display category In reply to
unfortunately this isn't working. i forgot to mention that i'm using the category global to display all of the categories on each page. but this lists all of them, when i don't want to display certain ones.

here's the global i use to display all of the categories.

Quote:


sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');
my $sth = $cat_db->select ( { FatherID => 0 } );

my $output="";
my $root = [];
while (my $root_cat = $sth->fetchrow_hashref) {
push @$root, $root_cat;
}
$output = Links::SiteHTML::display ('print_cat', $root);
return $output;
}


and here is the code i tried to get it to not display the category wrinkle

Quote:


<%unless category_info eq Wrinkle%><%category_info%>
but unfortunately it still displayed the category. any suggestions?
Quote Reply
Re: [Gregorio] don't display category In reply to
any idea?
Quote Reply
Re: [Gregorio] don't display category In reply to
Hi,

I'm not really sure what you are trying to do, specifically.

Root catagories have a FatherID of 0. That makes them easy to find.

In the code above, you were picking off the category from the list,and inserting it into another list. Before inserting it, you could do some checks on it to make sure it was what you wanted.

But I read this yesterday, and again today, and I still don't see what you are trying to do. <G> Programmers like specifics ;)


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] don't display category In reply to
ok, in summary, i want it to display all the categories on every page, EXCEPT, a couple of them. for example, if these are all of my categories:
cat
dog
mouse
fish

i want all of these categories to appear on each page, except for mouse. how do i do that? the code i posted for the global displays all of the categories, but i don't want mouse to show up, how do i do this? thanks.
Quote Reply
Re: [Gregorio] don't display category In reply to
Hi,

Add another variable 'Show' to your Links table set equal to 1 if you want the category to show and 0 if not.

Then in your global change the line

my $sth = $cat_db->select ( { FatherID => 0 } );


to

my $sth = $cat_db->select ( { FatherID => 0, Show => 1 } );

You only need to change the variable for the root categories that you want to show. However, if you just want to choose any categories, remove the FatherID=>0 and choose them with the Show variable.

Hope this makes sense.

Laura.
The UK High Street
Quote Reply
Re: [afinlr] don't display category In reply to
works great!!! thanks!!!
Quote Reply
Re: [afinlr] don't display category In reply to
In Reply To:
Add another variable 'Show' to your Links table

Hi Laura

Do you mean the Category table, not the Links table?

Just wanted to be sure.

Thanks Smile

------------------------------------------
Quote Reply
Re: [DogTags] don't display category In reply to
Tongue. Yes I meant the Category table.