[ic] Show/hide sub-navigation?

Thomas J.M. Burton interchange-users@icdevgroup.org
Mon Oct 28 19:51:01 2002


Hello,

I'm attempting to add a sub-navigation level to the category_vertical component and
have so far been unsuccessful. What I'd like to do is take the links that are added
under the area titles in the foundation demo and hide them unless the user is in that
area of the site.

Example:

The navbar on the left would contain the following:

    Bracelets
    Earrings
    Necklaces

Each area being a link (simple search) to that category of items. If a user clicks on
Earrings, the navigation would then expand like so:

    Bracelets
    Earrings
        Gold
        Silver
        Diamond
        Cubic Zirconia
    Necklaces


My approach was to set a scratch value on the results or flypage pages and compare
that in the loop that builds the navigation list. So far I haven't been able to get
that comparison to work in the category_vertical component. Here's what I have:

*snip*
[set found_cat][/set]
[loop
 prefix=box
 search="
  fi=area
  st=db
  tf=sort
  ac=0
  ac=0
  co=yes

  sf=sel
  op=eq
  se=[control set_selector left]

  sf=which_page
  op=rm
  se=[control page_class all|@@MV_PAGE@@]
"]
  <div class="nav1">[box-exec bar_link]area[/box-exec]</div>

[set found_cat]1[/set]
<!--
[perl]
 $parentDb = area;
 $parentField = prod_group;
 $parentCode = "[box-code]";
[/perl]
-->

//
// This is where I'm trying to compare the current loop item's name to scratch sectID
//

[if data area::name::[box-code] =~ /[scratch sectID]/]
[loop prefix=cat
 search="
  fi=cat
  st=db
  tf=sort
  tf=name
  rf=code,name
  sf=sel
  se=[box-code]
"]

    <div class="nav2">[cat-exec nav2_link]cat[/cat-exec]</div>

[/loop]
[/if]
[/loop]
*snip*

It seems that the [scratch sectID] is not being interpolated within the if tag. I've
tried writing the if using Perl tags, but I'm not sure if I got the syntax right.
What's the right way to go about this?

I'm running IC 4.8.6.
For a visual example, go to http://ght.gfdm.net/cgi-bin/ght


Thanks,
Tom Burton
___________________________________
Thomas J.M. Burton, Design/Production
Global Focus Digital Media, LLC
www.globalfocusdm.com
[541] 342.5717