Page 1 of 1

Checking categories w/ $category_info.parentid

Posted: Sun Aug 02, 2009 5:48 pm
by yellowled
Kind of hard to explain, but I'll try. I'm using hard-coded stuff in a client's template to emit a secondary navigation in the sidebar. This site uses a lot of categories which also are nested.

So the basic code for emitting the secondary nav in category view looks like this:

Code: Select all

{elseif $view == 'categories'}
  {if $category_info.parentid == '2'}
    {include file="sidenav_schule.tpl"}
  {elseif $category_info.parentid == '1'}
    {include file="sidenav_kinderhaus.tpl"}
etc. etc. This worked perfectly fine until I had to add more categories. For some weird reason, this does not seem to work any longer with three-digit values for $category_info.parentid (as far as I can tell), and only in category view.

Does this make any sense? Might this be a bug?

YL

Re: Checking categories w/ $category_info.parentid

Posted: Sun Aug 02, 2009 9:19 pm
by Don Chambers
Are you saying this does NOT work:

Code: Select all

  {elseif $category_info.parentid == '100'}
    {include file="sidenav_whatever_100.tpl"}
but this DOES work:

Code: Select all

  {elseif $category_info.parentid == '99'}
    {include file="sidenav_whatever_99.tpl"}
:?: :?: :?:

Re: Checking categories w/ $category_info.parentid

Posted: Sun Aug 02, 2009 9:24 pm
by yellowled
As far as I can reproduce it, yes, that's what I'm saying.

YL

Re: Checking categories w/ $category_info.parentid

Posted: Sun Aug 02, 2009 9:33 pm
by Don Chambers
I cannot see how 3 digits vs. 2 digits would matter... are you ABSOLUTELY sure $category_info.parentid == '100'?? Do you see that in the table, echoing it to the page, or viewing via {$debug}? ping me via AIM if you want me to help you debug... I'm not doing much else at the moment anyway! :wink:

Re: Checking categories w/ $category_info.parentid

Posted: Sun Aug 02, 2009 11:28 pm
by yellowled
GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH!

If you hear a repetetive noise while reading this, it's just my head bonking against the wall for not realizing that I made a stupid C&P error :-) $entry_category.parentid is NOT the same as $category_info.parentid, stoopid.

So, no, this is not a bug, it's working fine. Just PEBKAC. (Problem exists between keyboard and chair.)

YL

Re: Checking categories w/ $category_info.parentid

Posted: Mon Aug 03, 2009 1:43 am
by Don Chambers
Have had more than my share of those too!! :lol: Glad to hear you found the real problem.