Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Show in all but 1 or two categories

Quote Reply
Show in all but 1 or two categories
I am still rtying to keep using only one template set (and one category page) and I use a "random" on the category page. I want to be able to have the system only show the random if it is not in cat x and y

so, it will show it if it is in any other category. (seems like the best approach if most categories I do want it to show, right?)

What would the if statement be for this, and how could I have more than 1 item that is is not?

Thanks. Smile My site is rocking because of LinksSQL (and all the help you have given me)!

Last edited by:

Evoir: Aug 16, 2002, 12:29 PM
Quote Reply
Re: [Evoir] Show in all but 1 or two categories In reply to
Hi

Try <%if ID eq XX%>

something

<%endif%>
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Show in all but 1 or two categories In reply to
Thanks katabd,

I am hoping to not have to add a list of all the categories. Instead, I'd like to list the ones that I want the item to NOT show up in. The idea is like this

<%ifnot category x,z%>

something

<%endif%>

So that if it is NOT one of the listed categories, then it will show the item (in my case, a random link)

So, I don't know how to write the ifnot and I don't know how to name more than one category in the ifnot.

Smile I really like the picture you ahve of the baby. Made me smile.

Last edited by:

Evoir: Aug 16, 2002, 1:02 PM
Quote Reply
Re: [Evoir] Show in all but 1 or two categories In reply to
Ok



someone correct me if I ma wrong..

that does require a plug in to do..

the simple way i think will be to add a field to the category table called something..

then default it to NO and set the once you want to display the random link to Yes..

then do

<%if something eq Yes%>

whatever

<%endif%>

>>I really like the picture you ahve of the baby. Made me smile.

Thanks
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [Evoir] Show in all but 1 or two categories In reply to
Try this global, I call it "get_hide_random":
Code:
sub {
my $cat_id = shift;
my @hidden_cats = qw/1 2 4 56 124 345/;
return { hide_random => scalar grep /^$cat_id$/, @hidden_cats};
}
and use as
Code:
<%get_hide_random($ID)%>
<%unless hide_random%>
show your random stuff
<%endunless%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Show in all but 1 or two categories In reply to
That sounds way nicer than my idea.... Blush
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Show in all but 1 or two categories In reply to
Yogi, as always. Thank you. That was a beautiful solution. Thanks.
Quote Reply
Re: [Evoir] Show in all but 1 or two categories In reply to
Why not just add a new field? Something like;

<%DoShow%>

Then, in the templatesd use something like;

<%if DoShow%>
stuff here
<%else%>
other stuff here
<%endif%>

Unsure

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!