[ic] Show/hide sub-navigation?

Bill Carr interchange-users@icdevgroup.org
Mon Oct 28 20:54:00 2002


> -----Original Message-----
> From: interchange-users-admin@icdevgroup.org
> [mailto:interchange-users-admin@icdevgroup.org]On Behalf Of Thomas J.M.
> Burton
> Sent: Monday, October 28, 2002 7:51 PM
> To: interchange-users@icdevgroup.org
> Subject: [ic] Show/hide sub-navigation?
>
>
> 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.
Try [scratch sectID] on the page to see it's value. Try a hard coded value
in your if statement.

Bill Carr