Gossamer Forum
Home : Products : Gossamer Links : Discussions :

If category_short eq not working

Quote Reply
If category_short eq not working
Hi, can't this be done

<%if category_short eq 'word1 word2'%>...<%endif%>

this works

<%if category_short eq 'word1'%>...<%endif%>

is it the gap in category_short?
Quote Reply
Re: [garrynz] If category_short eq not working In reply to
Try;

<%if Category_Short eq "Something" or Category_Short eq "SomethingElse"%>

With your one, its effectivly doing something like;

if $Category_Short eq "word1 word2";

..which obviously won't work, as it won't match both the words =)

Hope that helps.

Cheers

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_short eq not working In reply to
Thanks Andy, I should of been more clear, word1 word2 is the name of the category i.e

<%if category_short eq 'Home and Garden'%>...<%endif%> doesn't work.

I can do this though

<%if category_name_escaped eq 'Recreation%2FHome%20and%20Garden'%>...<%endif%>

But would still like to know if it can be done with category_short ?
Quote Reply
Re: [garrynz] If category_short eq not working In reply to
So <%if category_name eq 'Home and Garden'%>...<%endif%> doesn't work?

Cheers

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_short eq not working In reply to
No <%if category_name eq 'Home and Garden'%>...<%endif%> doesn't work, neither does <%if category_name eq 'Recreation/Home and Garden'%>...<%endif%>

but <%if category_name eq 'Recreation/Travel'%>...<%endif%> does.

Last edited by:

garrynz: Dec 21, 2005, 6:06 AM
Quote Reply
Re: [garrynz] If category_short eq not working In reply to
MMm.. what value does category_name have when you do a <%GT::Template::dump%>

It shouldn't be working like your saying :/

Cheers

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_short eq not working In reply to
category_name = Recreation/Home and Garden
category_short = Home and Garden

Does it work if you try it on a category with spaces?
Quote Reply
Re: [garrynz] If category_short eq not working In reply to
Hi,

Sounds like you need to use "contains";

<, >, <=, >=, ==, !=, lt, gt, le, ge, eq, ne, contains, starts, and ends.

i.e;

<%if category_name contains "Home and Garden"%>

Hope that helps.

Cheers

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: [garrynz] If category_short eq not working In reply to
It looks like it's a bug in the template parser. It's taking category_short eq 'Home and Garden' as $category_short eq 'Home' and $Garden. The workaround for this is to use <%if category_short eq "Home \and Garden"%>

Adrian

Last edited by:

brewt: Dec 21, 2005, 12:59 PM
Quote Reply
Re: [brewt] If category_short eq not working In reply to
Thanks for all the help guys, that seemed to do the trick Brewt.