Gossamer Forum
Home : Products : Gossamer Links : Discussions :

<%if category_links > 1%>

(Page 2 of 2)
> >
Quote Reply
Re: [Paul] <%if category_links > 1%> In reply to
I do not get anything:

Unknown Tag: 'category_links'

I had it working this morning, now I am really confused Crazy
Quote Reply
Re: [Paul] <%if category_links > 1%> In reply to
Okay Paul, Ivan and Andy.

Sorry for making everybody go in limbo.

I did have a global that was returning the links in the same category on a detailed page. Now with Ivan's global, I get the total count of links in a category.



But When I try to use Ivan's global like this:

<%if linkstotal($ID) > 1%><%category_links%><%endif%> I get nothing.

When I try <%linkstotal($ID)%> by itself, I do get the right count, but when compared to another number, I don't get anything...

Thank you for your time.
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
It is a parser limitation I'm afraid, you can't use global tags inside if tags. I tried to think of a way round it but my boiled eggs need continual attention :)

If I think of anything and no-one has replied I'll let you know.

Last edited by:

Paul: Aug 7, 2002, 7:43 AM
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
What about;

<%if linkstotal($ID) > 1%><%linkstotal($ID)%><%endif%>

Just guessing here 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
I had tried that and had no success Frown
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
Ok..so maybe it is a limit in the template parser, as Paul stated. If so, I'm not sure if there is a way around it, without editing the parser itelf (something I would most definatly not want to do...lol) 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: [yogi] <%if category_links > 1%> In reply to
Try this
Code:
sub {
my $link_id = shift;
my ($cat_id, $cat_name) = each %{$DB->table('Links')->get_categories ($link_id)};
return { links_total => $DB->table('CatLinks')->count( { CategoryID => $cat_id }) };
}
and use it as

<%category_links($ID)%>
<%if links_total > 1%>
........
<%endif%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [Andy] <%if category_links > 1%> In reply to
Okay, I still appreciate your help Smile
Quote Reply
Re: [nt6] <%if category_links > 1%> In reply to
Mmm...what about;

Code:
sub {

my $link_id = shift;
my ($cat_id, $cat_name) = each %{$DB->table('Links')->get_categories ($link_id)};
my $send_back = $DB->table('CatLinks')->count( { CategoryID => $cat_id }); }

if (!$send_back) {

$send_back = "Nothing";

}

return $send_back;

That will return a number if anything is returned, if not, then it will print "Nothing" 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: [nt6] <%if category_links > 1%> In reply to
I can't figure this out...it seems globals/ifs do work together...

Code:
sub { return 1 }

<%if a%>
<%a%>
<%else%>
Nope
<%endif%>

Before I created the "a" global it showed nope, but after it printed 1
> >