Checking categories w/ $category_info.parentid

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Checking categories w/ $category_info.parentid

Post 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
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Checking categories w/ $category_info.parentid

Post 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"}
:?: :?: :?:
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Checking categories w/ $category_info.parentid

Post by yellowled »

As far as I can reproduce it, yes, that's what I'm saying.

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Checking categories w/ $category_info.parentid

Post 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:
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Checking categories w/ $category_info.parentid

Post 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
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Checking categories w/ $category_info.parentid

Post by Don Chambers »

Have had more than my share of those too!! :lol: Glad to hear you found the real problem.
=Don=
Post Reply