Gossamer Forum
Home : Products : Gossamer Links : Discussions :

<%if category_links > 1%>

(Page 1 of 2)
> >
Quote Reply
<%if category_links > 1%>
Hello,



this line isn't giving me what I am looking for. I would like to base a conditional statement on categories with more than one link in any given category. Any ideas?
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
I think you need >= (greater than or equal).

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!
Quote Reply
Re: [Andy] <%if category_links > 1%> In reply to
 I tried <%if category_links <= 1%> and it's not working. Smile
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
I said >= not <= Wink

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!
Quote Reply
Re: [Andy] <%if category_links > 1%> In reply to
Okay,Smile but the condition is that there is more than one link, and both ways this is not working. It's possible I am missing a little something in the syntaxCrazy
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
Have you tried putting the value in quotes, i.e.; > '1'

All the best
Shaun
Quote Reply
Re: [qango] <%if category_links > 1%> In reply to
Yes, this is what I tried:

<%if category_links >'1'%><%category_links%><%endif%>

and it doesn't work Frown
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
<%if total > 1%>

or

<%if Number_of_Links > 1%>

dending on what you want.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] <%if category_links > 1%> In reply to
Smile Thank you Ivan.
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
You're welcome.

If you want to know what tags are available on a page, just put

<%GT::Template::dump%>

at the bottom of the page. This really helps.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] <%if category_links > 1%> In reply to
Actually I just tried and both tags:

<%total%> & <%Number_of_links%> are not displayed in the list. What to do?
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
Which template are we talking about?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] <%if category_links > 1%> In reply to
"default", and I am trying to use this on a detailed page.
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
As Yogi said, you need to try a <%GT::Template::dump%> in the template, to see what tag it is you need to use. You may want to post the contents here.

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!
Quote Reply
Re: [Andy] <%if category_links > 1%> In reply to
In Reply To:
As Yogi said, you need to try a <%GT::Template::dump%> in the template, to see what tag it is you need to use. You may want to post the contents here.
I did exactly that. I do not have the two tags mentioned by Yogi in the list. Again this is a detailed page. Not a category page, could that be what is causing the tags not to be listed?
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
Do you have a URL we can look at to see what tags are available? (i.e a detailed page that was built with the dump tag in).

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!
Quote Reply
Re: [Andy] <%if category_links > 1%> In reply to
 
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
Ok, and you are trying to check the number of hits, or links in a category?

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!
Quote Reply
Re: [Andy] <%if category_links > 1%> In reply to
The number of links in a category.
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
I don't think this is possible. You may have to write a global to do it....Frown

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!
Quote Reply
Re: [Andy] <%if category_links > 1%> In reply to
I had that feeling now. Frown I haven't got anywhere near writing my own globals...

Last edited by:

nt6: Aug 7, 2002, 4:05 AM
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
Try this global
Code:
sub {
my $link_id = shift;
my ($cat_id, $cat_name) = each %{$DB->table('Links')->get_categories ($link_id)};
return $DB->table('CatLinks')->count( { CategoryID => $cat_id });
}
and use it as

<%category_links($ID)%>

in your details template. This should give the number ofl links in the same category

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] <%if category_links > 1%> In reply to
Isn't there a global already in that dump doing that?

>>
category_links $VAR = 'CODE(0x8641f24)';
<<
Quote Reply
Re: [Paul] <%if category_links > 1%> In reply to
I really do not have a clue. Is there?
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
If you put <%category_links%> in detailed.html what do you see after building?
> >